lintje 0.2.0 → 0.4.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 +2 -2
- package/dist-elements/actions.js +1 -1
- package/dist-elements/chunks/{base-Bg-IFOPG.js → base-DRGvkF-r.js} +484 -309
- package/dist-elements/chunks/{controls-B1455oPG.js → controls-_4ac1Lpz.js} +7 -1
- package/dist-elements/chunks/{date-format-mHtZyBys.js → date-format-DxP9yfDp.js} +1 -1
- package/dist-elements/chunks/dialog-B7aRBtjy.js +28 -0
- package/dist-elements/chunks/{disclosure-BXTX04gM.js → disclosure-D39vAR5q.js} +1 -1
- package/dist-elements/chunks/{disclosure-CMXhX-Vb.js → disclosure-DirPLy2E.js} +6 -6
- package/dist-elements/chunks/download-C68kcwPj.js +206 -0
- package/dist-elements/chunks/{focus-trap-9BnE-xWv.js → focus-trap-Dv8zu64A.js} +1 -1
- package/dist-elements/chunks/input-BGMLam-O.js +195 -0
- package/dist-elements/chunks/input-lQTmOMOz.js +4 -0
- package/dist-elements/chunks/{player-DXOZEyEy.js → player-BApadXr8.js} +27 -27
- package/dist-elements/chunks/{sentence-BI3lwEuT.js → sentence-0wO85ZdJ.js} +3 -3
- package/dist-elements/chunks/{stagger-qGD3wmhg.js → stagger-BB_gcxBI.js} +88 -74
- package/dist-elements/content.js +1 -0
- package/dist-elements/core.js +1 -1
- package/dist-elements/custom-elements.json +8858 -7715
- package/dist-elements/data-types.json +6900 -0
- package/dist-elements/feedback.js +2 -1
- package/dist-elements/frame.js +0 -2
- package/dist-elements/guides/dashboard.md +8 -0
- package/dist-elements/guides/events.md +4 -5
- package/dist-elements/guides/loading.md +10 -9
- package/dist-elements/guides/page-contents.md +110 -0
- package/dist-elements/guides/start.md +12 -0
- package/dist-elements/inputs.js +3 -1
- package/dist-elements/layout.js +1 -1
- package/dist-elements/lintje.js +8562 -7138
- package/dist-elements/overlays.js +2 -2
- package/dist-elements/skills/lintje/SKILL.md +1 -1
- package/dist-elements/tables.js +1 -1
- package/dist-elements/tag/activity-log.js +15 -15
- package/dist-elements/tag/ai-label.js +10 -10
- package/dist-elements/tag/announcement.js +36 -76
- package/dist-elements/tag/app-search.js +49 -49
- package/dist-elements/tag/audio-player.js +57 -57
- package/dist-elements/tag/badge.d.ts +1 -1
- package/dist-elements/tag/badge.js +1 -1
- package/dist-elements/tag/breadcrumbs.js +15 -15
- package/dist-elements/tag/button.d.ts +1 -1
- package/dist-elements/tag/button.js +1 -1
- package/dist-elements/tag/card-list.js +12 -12
- package/dist-elements/tag/card.js +39 -44
- package/dist-elements/tag/chart.js +1357 -787
- package/dist-elements/tag/chat-answer.js +49 -49
- package/dist-elements/tag/chat-composer.js +75 -71
- package/dist-elements/tag/chat-message.js +8 -8
- package/dist-elements/tag/chat-strip.js +22 -22
- package/dist-elements/tag/chat-suggestions.js +12 -12
- package/dist-elements/tag/chat.js +56 -56
- package/dist-elements/tag/checkbox-group.d.ts +1 -0
- package/dist-elements/tag/checkbox-group.js +60 -0
- package/dist-elements/tag/checkbox.js +9 -8
- package/dist-elements/tag/code.js +9 -9
- package/dist-elements/tag/combobox.js +19 -18
- package/dist-elements/tag/conflict-alert.js +12 -12
- package/dist-elements/tag/copy-button.js +14 -14
- package/dist-elements/tag/data-table.js +880 -532
- package/dist-elements/tag/date-input.js +30 -29
- package/dist-elements/tag/date-range.js +39 -38
- package/dist-elements/tag/description-list.js +29 -32
- package/dist-elements/tag/dialog.d.ts +1 -0
- package/dist-elements/tag/dialog.js +144 -0
- package/dist-elements/tag/document-viewer.js +23 -23
- package/dist-elements/tag/drawer.js +28 -32
- package/dist-elements/tag/empty-state.js +19 -30
- package/dist-elements/tag/error-page.d.ts +1 -0
- package/dist-elements/tag/error-page.js +109 -0
- package/dist-elements/tag/error-summary.js +10 -10
- package/dist-elements/tag/expander.js +8 -8
- package/dist-elements/tag/explainer.js +11 -11
- package/dist-elements/tag/field.js +5 -5
- package/dist-elements/tag/file-upload.js +35 -34
- package/dist-elements/tag/filter-bar.js +56 -56
- package/dist-elements/tag/filter-sheet.js +11 -11
- package/dist-elements/tag/filter-zone.js +31 -31
- package/dist-elements/tag/find.d.ts +1 -0
- package/dist-elements/tag/find.js +128 -0
- package/dist-elements/tag/footer.js +21 -21
- package/dist-elements/tag/form-actions.js +29 -25
- package/dist-elements/tag/form-section.js +6 -6
- package/dist-elements/tag/form.js +12 -12
- package/dist-elements/tag/gallery.js +14 -14
- package/dist-elements/tag/grid-item.d.ts +1 -1
- package/dist-elements/tag/grid-item.js +1 -1
- package/dist-elements/tag/grid.d.ts +1 -1
- package/dist-elements/tag/grid.js +1 -1
- package/dist-elements/tag/hero.js +12 -12
- package/dist-elements/tag/highlight.js +5 -5
- package/dist-elements/tag/icon-button.d.ts +1 -1
- package/dist-elements/tag/icon-button.js +1 -1
- package/dist-elements/tag/icon.d.ts +1 -1
- package/dist-elements/tag/icon.js +1 -1
- package/dist-elements/tag/job-list.js +22 -44
- package/dist-elements/tag/kpi-row.js +12 -10
- package/dist-elements/tag/kpi.js +149 -140
- package/dist-elements/tag/level-meter.js +11 -11
- package/dist-elements/tag/list.js +55 -55
- package/dist-elements/tag/logo.js +30 -30
- package/dist-elements/tag/map.js +702 -671
- package/dist-elements/tag/menu-button.js +70 -69
- package/dist-elements/tag/modal.js +28 -37
- package/dist-elements/tag/multiselect.js +35 -34
- package/dist-elements/tag/note.js +5 -5
- package/dist-elements/tag/notifications.js +36 -36
- package/dist-elements/tag/number-input.js +13 -12
- package/dist-elements/tag/page-header.js +140 -37
- package/dist-elements/tag/pagination.js +54 -49
- package/dist-elements/tag/popover.d.ts +1 -1
- package/dist-elements/tag/popover.js +1 -1
- package/dist-elements/tag/progress-bar.d.ts +1 -1
- package/dist-elements/tag/progress-bar.js +1 -1
- package/dist-elements/tag/prose.js +6 -6
- package/dist-elements/tag/qr-code.js +7 -7
- package/dist-elements/tag/radio-group.js +13 -12
- package/dist-elements/tag/range.js +23 -22
- package/dist-elements/tag/recording-status.js +14 -14
- package/dist-elements/tag/repeater.js +10 -10
- package/dist-elements/tag/segmented.js +14 -13
- package/dist-elements/tag/select.js +11 -10
- package/dist-elements/tag/shell.js +356 -339
- package/dist-elements/tag/skeleton.d.ts +1 -1
- package/dist-elements/tag/skeleton.js +1 -1
- package/dist-elements/tag/slot-picker.js +16 -15
- package/dist-elements/tag/sortable-list.js +14 -14
- package/dist-elements/tag/spinner.d.ts +1 -1
- package/dist-elements/tag/spinner.js +1 -1
- package/dist-elements/tag/split-pane.js +12 -12
- package/dist-elements/tag/status-dot.d.ts +1 -1
- package/dist-elements/tag/status-dot.js +1 -1
- package/dist-elements/tag/stepper.js +21 -21
- package/dist-elements/tag/streaming-text.js +13 -13
- package/dist-elements/tag/sub-nav.js +39 -38
- package/dist-elements/tag/tabs.js +38 -38
- package/dist-elements/tag/tag-input.js +20 -19
- package/dist-elements/tag/text-editor.js +25 -24
- package/dist-elements/tag/text-input.js +15 -14
- package/dist-elements/tag/textarea.js +15 -14
- package/dist-elements/tag/tile.d.ts +1 -1
- package/dist-elements/tag/tile.js +1 -1
- package/dist-elements/tag/time-input.js +20 -19
- package/dist-elements/tag/toast.js +32 -23
- package/dist-elements/tag/toggle.js +9 -8
- package/dist-elements/tag/toggletip.js +27 -27
- package/dist-elements/tag/token-value.d.ts +1 -0
- package/dist-elements/tag/token-value.js +75 -0
- package/dist-elements/tag/tooltip.d.ts +1 -1
- package/dist-elements/tag/tooltip.js +1 -1
- package/dist-elements/tag/transcript.js +48 -48
- package/dist-elements/tag/translator.js +13 -13
- package/dist-elements/tag/tree-view.js +13 -13
- package/dist-elements/tag/user-menu.js +37 -37
- package/dist-elements/tag/video-player.js +21 -21
- package/dist-elements/tokens.css +120 -96
- package/dist-elements/tokens.json +1244 -0
- package/dist-elements/types/bundle/actions.d.ts +3 -3
- package/dist-elements/types/bundle/content.d.ts +1 -0
- package/dist-elements/types/bundle/feedback.d.ts +6 -5
- package/dist-elements/types/bundle/frame.d.ts +0 -2
- package/dist-elements/types/bundle/index.d.ts +0 -10
- package/dist-elements/types/bundle/inputs.d.ts +2 -0
- package/dist-elements/types/bundle/layout.d.ts +3 -3
- package/dist-elements/types/bundle/overlays.d.ts +3 -3
- package/dist-elements/types/categories.d.ts +4 -0
- package/dist-elements/types/{primitives → components/actions}/button/button.d.ts +13 -10
- package/dist-elements/types/components/actions/copy-button/copy-button.d.ts +8 -9
- package/dist-elements/types/{icons → components/actions}/icon/icon.d.ts +4 -5
- package/dist-elements/types/{primitives → components/actions}/icon-button/icon-button.d.ts +8 -6
- package/dist-elements/types/components/actions/menu-button/menu-button.d.ts +16 -18
- package/dist-elements/types/components/actions/qr-code/qr-code.d.ts +10 -10
- package/dist-elements/types/components/charts/chart/chart.d.ts +6 -5
- package/dist-elements/types/components/charts/explainer/explainer.d.ts +1 -1
- package/dist-elements/types/components/charts/kpi/kpi.d.ts +19 -11
- package/dist-elements/types/components/charts/kpi-row/kpi-row.d.ts +2 -8
- package/dist-elements/types/components/charts/note/note.d.ts +2 -2
- package/dist-elements/types/components/chat/chat/chat.d.ts +9 -11
- package/dist-elements/types/components/chat/chat-answer/chat-answer.d.ts +10 -11
- package/dist-elements/types/components/chat/chat-composer/chat-composer.d.ts +10 -12
- package/dist-elements/types/components/chat/chat-message/chat-message.d.ts +7 -8
- package/dist-elements/types/components/chat/chat-strip/chat-strip.d.ts +5 -5
- package/dist-elements/types/components/chat/chat-suggestions/chat-suggestions.d.ts +9 -10
- package/dist-elements/types/components/content/audio-player/audio-player.d.ts +15 -17
- package/dist-elements/types/components/content/code/code.d.ts +3 -4
- package/dist-elements/types/components/content/document-viewer/document-viewer.d.ts +10 -11
- package/dist-elements/types/components/content/gallery/gallery.d.ts +5 -4
- package/dist-elements/types/components/content/highlight/highlight.d.ts +5 -4
- package/dist-elements/types/components/content/prose/prose.d.ts +3 -4
- package/dist-elements/types/components/content/token-value/token-value.d.ts +42 -0
- package/dist-elements/types/components/content/transcript/transcript.d.ts +15 -28
- package/dist-elements/types/components/content/translator/translator.d.ts +12 -16
- package/dist-elements/types/components/content/video-player/video-player.d.ts +12 -14
- package/dist-elements/types/components/feedback/ai-label/ai-label.d.ts +3 -4
- package/dist-elements/types/components/feedback/announcement/announcement.d.ts +5 -9
- package/dist-elements/types/{primitives → components/feedback}/badge/badge.d.ts +10 -6
- package/dist-elements/types/components/feedback/conflict-alert/conflict-alert.d.ts +4 -5
- package/dist-elements/types/components/feedback/empty-state/empty-state.d.ts +5 -8
- package/dist-elements/types/components/feedback/error-page/error-page.d.ts +52 -0
- package/dist-elements/types/components/feedback/job-list/job-list.d.ts +9 -12
- package/dist-elements/types/components/feedback/level-meter/level-meter.d.ts +4 -6
- package/dist-elements/types/{primitives → components/feedback}/progress-bar/progress-bar.d.ts +9 -7
- package/dist-elements/types/components/feedback/recording-status/recording-status.d.ts +5 -6
- package/dist-elements/types/{primitives → components/feedback}/skeleton/skeleton.d.ts +2 -2
- package/dist-elements/types/{primitives → components/feedback}/spinner/spinner.d.ts +2 -3
- package/dist-elements/types/{primitives → components/feedback}/status-dot/status-dot.d.ts +5 -6
- package/dist-elements/types/components/feedback/streaming-text/streaming-text.d.ts +12 -9
- package/dist-elements/types/components/feedback/toast/toast.d.ts +8 -9
- package/dist-elements/types/components/filters/filter-bar/filter-bar.d.ts +9 -4
- package/dist-elements/types/components/filters/filter-sheet/filter-sheet.d.ts +7 -7
- package/dist-elements/types/components/filters/filter-zone/filter-zone.d.ts +4 -4
- package/dist-elements/types/components/forms/error-summary/error-summary.d.ts +6 -7
- package/dist-elements/types/components/forms/form/form.d.ts +5 -5
- package/dist-elements/types/components/forms/form-actions/form-actions.d.ts +10 -8
- package/dist-elements/types/components/forms/form-section/form-section.d.ts +6 -5
- package/dist-elements/types/components/forms/repeater/repeater.d.ts +15 -9
- package/dist-elements/types/components/forms/stepper/stepper.d.ts +6 -5
- package/dist-elements/types/components/frame/app-search/app-search.d.ts +7 -8
- package/dist-elements/types/components/frame/breadcrumbs/breadcrumbs.d.ts +2 -2
- package/dist-elements/types/components/frame/footer/footer.d.ts +3 -2
- package/dist-elements/types/components/frame/hero/hero.d.ts +7 -9
- package/dist-elements/types/components/frame/notifications/notifications.d.ts +7 -11
- package/dist-elements/types/components/frame/page-header/page-header.d.ts +13 -16
- package/dist-elements/types/components/frame/shell/shell.d.ts +15 -14
- package/dist-elements/types/components/frame/sub-nav/sub-nav.d.ts +10 -6
- package/dist-elements/types/components/frame/user-menu/user-menu.d.ts +13 -12
- package/dist-elements/types/components/index.d.ts +51 -12
- package/dist-elements/types/components/inputs/checkbox/checkbox.d.ts +4 -4
- package/dist-elements/types/components/inputs/checkbox-group/checkbox-group.d.ts +33 -0
- package/dist-elements/types/components/inputs/combobox/combobox.d.ts +14 -8
- package/dist-elements/types/components/inputs/date-input/date-input.d.ts +6 -6
- package/dist-elements/types/components/inputs/date-range/date-range.d.ts +13 -8
- package/dist-elements/types/components/inputs/field/field.d.ts +5 -3
- package/dist-elements/types/components/inputs/file-upload/file-upload.d.ts +8 -10
- package/dist-elements/types/components/inputs/find/find.d.ts +51 -0
- package/dist-elements/types/components/inputs/multiselect/multiselect.d.ts +4 -6
- package/dist-elements/types/components/inputs/number-input/number-input.d.ts +8 -7
- package/dist-elements/types/components/inputs/radio-group/radio-group.d.ts +2 -4
- package/dist-elements/types/components/inputs/range/range.d.ts +5 -6
- package/dist-elements/types/components/inputs/segmented/segmented.d.ts +7 -4
- package/dist-elements/types/components/inputs/select/select.d.ts +6 -3
- package/dist-elements/types/components/inputs/shared/input.d.ts +1 -1
- package/dist-elements/types/components/inputs/slot-picker/slot-picker.d.ts +6 -5
- package/dist-elements/types/components/inputs/tag-input/tag-input.d.ts +8 -6
- package/dist-elements/types/components/inputs/text-editor/text-editor.d.ts +8 -8
- package/dist-elements/types/components/inputs/text-input/text-input.d.ts +12 -7
- package/dist-elements/types/components/inputs/textarea/textarea.d.ts +12 -11
- package/dist-elements/types/components/inputs/time-input/time-input.d.ts +8 -9
- package/dist-elements/types/components/inputs/toggle/toggle.d.ts +3 -1
- package/dist-elements/types/components/layout/expander/expander.d.ts +10 -11
- package/dist-elements/types/{primitives → components/layout}/grid/grid.d.ts +4 -4
- package/dist-elements/types/{primitives → components/layout}/grid-item/grid-item.d.ts +2 -2
- package/dist-elements/types/components/layout/split-pane/split-pane.d.ts +6 -6
- package/dist-elements/types/components/layout/tabs/tabs.d.ts +12 -10
- package/dist-elements/types/{primitives → components/layout}/tile/tile.d.ts +22 -10
- package/dist-elements/types/components/map/map/map.d.ts +12 -11
- package/dist-elements/types/components/overlays/dialog/dialog.d.ts +49 -0
- package/dist-elements/types/components/overlays/drawer/drawer.d.ts +6 -5
- package/dist-elements/types/components/overlays/modal/modal.d.ts +9 -14
- package/dist-elements/types/{primitives → components/overlays}/popover/popover.d.ts +7 -6
- package/dist-elements/types/components/overlays/toggletip/toggletip.d.ts +4 -8
- package/dist-elements/types/{primitives → components/overlays}/tooltip/tooltip.d.ts +8 -8
- package/dist-elements/types/components/shared/announcement-block.d.ts +38 -0
- package/dist-elements/types/components/shared/charts/index.d.ts +5 -1
- package/dist-elements/types/components/shared/charts/kinds.d.ts +92 -0
- package/dist-elements/types/components/shared/charts/line-chart/line-chart.d.ts +2 -2
- package/dist-elements/types/components/shared/charts/map-chart/leaflet.d.ts +5 -0
- package/dist-elements/types/components/shared/charts/map-chart/map-chart.d.ts +1 -1
- package/dist-elements/types/components/shared/charts/radar-chart/radar-chart.d.ts +31 -0
- package/dist-elements/types/components/shared/charts/shared/axes.d.ts +3 -1
- package/dist-elements/types/components/shared/charts/shared/chart-states.d.ts +8 -19
- package/dist-elements/types/components/shared/charts/shared/controller.d.ts +12 -0
- package/dist-elements/types/components/shared/charts/shared/types.d.ts +62 -0
- package/dist-elements/types/components/shared/charts/stacked-area-chart/stacked-area-chart.d.ts +13 -0
- package/dist-elements/types/components/shared/content-tile.d.ts +1 -1
- package/dist-elements/types/components/{forms/form → shared}/controls.d.ts +3 -2
- package/dist-elements/types/components/shared/dialog.d.ts +9 -0
- package/dist-elements/types/components/shared/empty-state-block.d.ts +26 -0
- package/dist-elements/types/components/shared/overflow.d.ts +58 -0
- package/dist-elements/types/components/shared/tone.d.ts +18 -0
- package/dist-elements/types/components/tables/activity-log/activity-log.d.ts +3 -4
- package/dist-elements/types/components/tables/card/card.d.ts +17 -23
- package/dist-elements/types/components/tables/card-list/card-list.d.ts +9 -11
- package/dist-elements/types/components/tables/data-table/actions.d.ts +1 -1
- package/dist-elements/types/components/tables/data-table/data-table.d.ts +88 -19
- package/dist-elements/types/components/tables/data-table/editing.d.ts +1 -1
- package/dist-elements/types/components/tables/data-table/filters.d.ts +15 -6
- package/dist-elements/types/components/tables/description-list/description-list.d.ts +13 -12
- package/dist-elements/types/components/tables/list/list.d.ts +13 -24
- package/dist-elements/types/components/tables/pagination/pagination.d.ts +12 -11
- package/dist-elements/types/components/tables/sortable-list/sortable-list.d.ts +5 -6
- package/dist-elements/types/components/tables/tree-view/tree-view.d.ts +5 -5
- package/dist-elements/types/core/focus.d.ts +1 -1
- package/dist-elements/types/core/media.d.ts +2 -2
- package/dist-elements/types/core/motion.d.ts +5 -0
- package/dist-elements/types/core/print.d.ts +15 -0
- package/dist-elements/types/core/shortcuts.d.ts +2 -2
- package/dist-elements/types/icons/register.d.ts +1 -1
- package/dist-elements/types/types.d.ts +70 -10
- package/dist-icons/functioneel-kolommen.svg +1 -0
- package/dist-icons/functioneel-trechter.svg +1 -0
- package/package.json +1 -1
- package/dist-elements/chunks/confirm-dialog-D5EVGuil.js +0 -4
- package/dist-elements/chunks/download-y528pIHP.js +0 -230
- package/dist-elements/chunks/input-BtuNFSWk.js +0 -195
- package/dist-elements/tag/confirm-dialog.d.ts +0 -1
- package/dist-elements/tag/confirm-dialog.js +0 -118
- package/dist-elements/tag/session-expiry.d.ts +0 -1
- package/dist-elements/tag/session-expiry.js +0 -184
- package/dist-elements/tag/shortcuts.d.ts +0 -1
- package/dist-elements/tag/shortcuts.js +0 -104
- package/dist-elements/types/components/frame/session-expiry/session-expiry.d.ts +0 -55
- package/dist-elements/types/components/frame/shortcuts/shortcuts.d.ts +0 -41
- package/dist-elements/types/components/overlays/confirm-dialog/confirm-dialog.d.ts +0 -41
- package/dist-elements/types/primitives/index.d.ts +0 -33
- /package/dist-elements/types/components/content/{audio-player → shared}/playback.d.ts +0 -0
- /package/dist-elements/types/components/content/{audio-player → shared}/player.d.ts +0 -0
- /package/dist-elements/types/components/{inputs/date-input → shared}/date-format.d.ts +0 -0
- /package/dist-elements/types/{primitives → components}/shared/grid-item-element.d.ts +0 -0
- /package/dist-elements/types/{primitives → components}/shared/length.d.ts +0 -0
- /package/dist-elements/types/{primitives → components}/shared/place.d.ts +0 -0
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
1
|
+
import { F as e, I as t, Kt as n, O as r, Yt as i, Zt as a, _ as o, bt as s, c, d as l, en as u, f as d, h as f, nn as p, o as m, p as h, r as g, rn as _, u as v, v as y, y as b } from "../chunks/base-DRGvkF-r.js";
|
|
2
|
+
import { t as x } from "./announcement.js";
|
|
3
3
|
import "./segmented.js";
|
|
4
|
-
import { a as
|
|
5
|
-
import { C as
|
|
4
|
+
import { a as S, c as C, i as w, n as T, t as E } from "../chunks/download-C68kcwPj.js";
|
|
5
|
+
import { C as D, E as O, S as k, T as A, _ as j, a as M, b as N, c as P, f as F, g as I, h as L, i as R, l as z, n as B, o as V, p as H, r as U, s as ee, t as te, u as W, v as G, w as K, x as q, y as ne } from "../chunks/stagger-BB_gcxBI.js";
|
|
6
6
|
import "./data-table.js";
|
|
7
7
|
//#region src/components/shared/charts/shared/plot-keys.ts
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
return `${e.title}: ${e.rows.map((e) => `${e.label} ${e.value}`.trim()).join(", ")}
|
|
8
|
+
var J = /* @__PURE__ */ new Set(["ArrowRight", "ArrowDown"]), Y = /* @__PURE__ */ new Set(["ArrowLeft", "ArrowUp"]);
|
|
9
|
+
function re(e) {
|
|
10
|
+
return [`${e.title}: ${e.rows.map((e) => `${e.label} ${e.value}`.trim()).join(", ")}`, ...(e.events ?? []).map((e) => `Gebeurtenis ${e.number}: ${e.label}`)].join(". ");
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function X(e) {
|
|
13
13
|
try {
|
|
14
14
|
return e.matches(":focus-visible");
|
|
15
15
|
} catch {
|
|
16
16
|
return !0;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Z(e, t, n) {
|
|
20
20
|
let r = (t, r) => {
|
|
21
21
|
let i = n(r), a = t.closest("[data-tooltip-anchor]"), o = t.getBoundingClientRect(), s = a?.getBoundingClientRect() ?? o;
|
|
22
|
-
e.hoverIndex = r, e.status =
|
|
22
|
+
e.hoverIndex = r, e.status = re(i.content), e.showTooltipAt(o.left - s.left + i.x, o.top - s.top + i.y, i.content);
|
|
23
23
|
};
|
|
24
24
|
return {
|
|
25
25
|
keydown(n) {
|
|
26
26
|
if (n.target !== n.currentTarget || t === 0) return;
|
|
27
27
|
let i = e.hoverIndex ?? -1, a;
|
|
28
|
-
if (
|
|
29
|
-
else if (
|
|
28
|
+
if (J.has(n.key)) a = Math.min(t - 1, i + 1);
|
|
29
|
+
else if (Y.has(n.key)) a = Math.max(0, i - 1);
|
|
30
30
|
else if (n.key === "Home") a = 0;
|
|
31
31
|
else if (n.key === "End") a = t - 1;
|
|
32
32
|
else return;
|
|
@@ -34,168 +34,205 @@ function Y(e, t, n) {
|
|
|
34
34
|
},
|
|
35
35
|
focus(n) {
|
|
36
36
|
let i = n.currentTarget;
|
|
37
|
-
n.target === i && t !== 0 &&
|
|
37
|
+
n.target === i && t !== 0 && X(i) && r(i, Math.min(e.hoverIndex ?? 0, t - 1));
|
|
38
38
|
},
|
|
39
39
|
blur() {
|
|
40
40
|
(e.hoverIndex != null || e.status) && (e.hoverIndex = null, e.status = "", e.hideTooltip(), e.requestUpdate());
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
return
|
|
44
|
+
function Q(e) {
|
|
45
|
+
return p`<p class="visually-hidden" role="status">${e.status}</p>`;
|
|
46
46
|
}
|
|
47
47
|
//#endregion
|
|
48
48
|
//#region src/components/shared/charts/line-chart/line-chart.ts
|
|
49
|
+
var $ = 18, ie = 4, ae = 8;
|
|
50
|
+
function oe(e) {
|
|
51
|
+
let t = [];
|
|
52
|
+
return e.map((e) => {
|
|
53
|
+
let n = t.findIndex((t) => t.every((t) => Math.abs(t - e) >= 22));
|
|
54
|
+
return n === -1 && (n = t.push([]) - 1), t[n].push(e), n;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
49
57
|
function se(e, t) {
|
|
50
|
-
let { controller:
|
|
51
|
-
|
|
58
|
+
let { controller: n, description: r } = t, { labels: i, axisTitle: a, unit: o, asOfIndex: c, asOfLabel: d, pendingHours: f = 0, fixedMax: g, small: v = !1 } = e, y = (e.events ?? []).filter((e) => Number.isInteger(e.index) && e.index >= 0 && e.index < i.length).sort((e, t) => e.index - t.index).map((e, t) => ({
|
|
59
|
+
...e,
|
|
60
|
+
number: t + 1
|
|
61
|
+
})), b = n.id;
|
|
62
|
+
n.measure({
|
|
52
63
|
width: !0,
|
|
53
|
-
height: t.height ?? (
|
|
64
|
+
height: t.height ?? (v ? "--chart-h-small" : "--chart-h-main"),
|
|
54
65
|
fit: !!t.expanded && !t.mobile
|
|
55
66
|
});
|
|
56
|
-
let
|
|
67
|
+
let x = e.series.filter((e) => !e.comparison).length > 1, S = 0, C = e.series.map((e) => ({
|
|
57
68
|
...e,
|
|
58
|
-
color:
|
|
59
|
-
symbol:
|
|
60
|
-
})),
|
|
61
|
-
fontFamily:
|
|
62
|
-
minimum: Math.ceil(
|
|
63
|
-
}),
|
|
69
|
+
color: F(e.color),
|
|
70
|
+
symbol: x && !e.comparison ? I(e.color) ? e.color : L[S++ % L.length] : void 0
|
|
71
|
+
})), w = C.filter((e) => !n.hiddenSeries.includes(e.label)), T = w.flatMap((e) => e.values).filter((e) => e != null), { max: E, ticks: k } = q(g ?? Math.max(...T, 1)), M = N(k, n.width, {
|
|
72
|
+
fontFamily: n.fontFamily,
|
|
73
|
+
minimum: Math.ceil(h(i[0] ?? "", n.fontFamily) / 2)
|
|
74
|
+
}), P = ne(t, { left: M.width }), R = y.map((e) => Math.min(P.width - $ / 2, Math.max($ / 2, A(e.index, i.length, P)))), B = oe(R), te = B.length ? Math.max(...B) + 1 : 0, W = ne(t, {
|
|
75
|
+
left: M.width,
|
|
76
|
+
...te ? { top: te * 22 + ae } : {}
|
|
77
|
+
}), G = (e) => ie + B[e] * 22, K = f > 6, J = c ?? i.length - 1, Y = (e) => e.comparison ? "var(--color-chart-secondary)" : e.color ?? "var(--color-chart-default)", re = C.map((e) => ({
|
|
64
78
|
label: e.label,
|
|
65
|
-
color:
|
|
79
|
+
color: Y(e),
|
|
66
80
|
shape: e.comparison ? "dashed" : "line",
|
|
67
81
|
symbol: e.symbol,
|
|
68
|
-
hidden:
|
|
69
|
-
})),
|
|
82
|
+
hidden: n.hiddenSeries.includes(e.label)
|
|
83
|
+
})), X = Math.max(1, Math.ceil(i.length / 8)), se = i.map((e, t) => ({
|
|
70
84
|
label: e,
|
|
71
|
-
x:
|
|
85
|
+
x: A(t, i.length, W),
|
|
72
86
|
i: t
|
|
73
|
-
})).filter((e) => e.i %
|
|
74
|
-
function
|
|
87
|
+
})).filter((e) => e.i % X === 0);
|
|
88
|
+
function ce(e) {
|
|
89
|
+
let t = y.filter((t) => t.index === e);
|
|
75
90
|
return {
|
|
76
|
-
title:
|
|
77
|
-
rows:
|
|
91
|
+
title: i[e],
|
|
92
|
+
rows: w.map((t) => ({
|
|
78
93
|
label: t.label,
|
|
79
|
-
value: t.values[e] == null ? "geen gegevens" :
|
|
80
|
-
color:
|
|
81
|
-
}))
|
|
94
|
+
value: t.values[e] == null ? "geen gegevens" : l(t.values[e]),
|
|
95
|
+
color: Y(t)
|
|
96
|
+
})),
|
|
97
|
+
...t.length ? { events: t } : {}
|
|
82
98
|
};
|
|
83
99
|
}
|
|
84
|
-
let
|
|
85
|
-
let t =
|
|
100
|
+
let le = Z(n, i.length, (e) => {
|
|
101
|
+
let t = w.map((t) => t.values[e]).filter((e) => e != null);
|
|
86
102
|
return {
|
|
87
|
-
x:
|
|
88
|
-
y: t.length ?
|
|
89
|
-
content:
|
|
103
|
+
x: A(e, i.length, W),
|
|
104
|
+
y: t.length ? O(Math.max(...t), E, W) : W.top,
|
|
105
|
+
content: ce(e)
|
|
90
106
|
};
|
|
91
|
-
}),
|
|
92
|
-
|
|
93
|
-
let e =
|
|
94
|
-
return
|
|
95
|
-
height=${
|
|
96
|
-
fill="url(#hatch-${
|
|
97
|
-
})() :
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
let
|
|
107
|
+
}), ue = [
|
|
108
|
+
f > 0 ? (() => {
|
|
109
|
+
let e = A(J, i.length, W), t = K ? D(W) / (i.length - 1) : W.width - W.right - e;
|
|
110
|
+
return _`<rect x=${e} y=${W.top} width=${Math.max(0, t)}
|
|
111
|
+
height=${W.height - W.top - W.bottom}
|
|
112
|
+
fill="url(#hatch-${b})" />`;
|
|
113
|
+
})() : u,
|
|
114
|
+
y.length ? _`<g>
|
|
115
|
+
${y.map((e, t) => {
|
|
116
|
+
let n = A(e.index, i.length, W);
|
|
117
|
+
return _`<line class="lintje-chart__event-line" x1=${n} x2=${n}
|
|
118
|
+
y1=${G(t) + $} y2=${W.height - W.bottom} />`;
|
|
119
|
+
})}
|
|
120
|
+
${y.map((e, t) => _`
|
|
121
|
+
<rect class="lintje-chart__event-chip" x=${R[t] - $ / 2} y=${G(t)}
|
|
122
|
+
width=${$} height=${$} />
|
|
123
|
+
<text class="lintje-chart__event-number" x=${R[t]} y=${G(t) + $ / 2}
|
|
124
|
+
text-anchor="middle" dominant-baseline="central">${e.number}</text>
|
|
125
|
+
`)}
|
|
126
|
+
</g>` : u,
|
|
127
|
+
_`<g class="lintje-chart__reveal">
|
|
128
|
+
${w.map((e) => {
|
|
129
|
+
let t = Y(e), n = e.comparison ? void 0 : H(t), r = [[]];
|
|
101
130
|
e.values.forEach((e, t) => {
|
|
102
|
-
e == null ||
|
|
103
|
-
x:
|
|
104
|
-
y:
|
|
131
|
+
e == null || K && t > J ? r[r.length - 1].length && r.push([]) : r[r.length - 1].push({
|
|
132
|
+
x: A(t, i.length, W),
|
|
133
|
+
y: O(e, E, W)
|
|
105
134
|
});
|
|
106
135
|
});
|
|
107
|
-
let
|
|
108
|
-
if (
|
|
109
|
-
let
|
|
110
|
-
return
|
|
136
|
+
let a = r.filter((e) => e.length > 0);
|
|
137
|
+
if (a.length === 0) return u;
|
|
138
|
+
let o = a[a.length - 1], s = o[o.length - 1], c = W.height - W.bottom;
|
|
139
|
+
return _`
|
|
111
140
|
<g>
|
|
112
|
-
${
|
|
113
|
-
let
|
|
114
|
-
return
|
|
115
|
-
${e.area && !e.comparison ?
|
|
116
|
-
points=${`${
|
|
117
|
-
${
|
|
118
|
-
${
|
|
141
|
+
${a.map((r) => {
|
|
142
|
+
let i = r.map((e) => `${e.x},${e.y}`).join(" ");
|
|
143
|
+
return _`
|
|
144
|
+
${e.area && !e.comparison ? _`<polygon fill=${t} fill-opacity=".14"
|
|
145
|
+
points=${`${r[0].x},${c} ${i} ${r[r.length - 1].x},${c}`} />` : u}
|
|
146
|
+
${n && r.length > 1 ? _`<polyline class="lintje-chart__line lintje-chart__line--casing" points=${i} stroke=${n} />` : u}
|
|
147
|
+
${r.length === 1 ? _`<circle cx=${r[0].x} cy=${r[0].y} r="2.5" fill=${t} />` : _`<polyline
|
|
119
148
|
class="lintje-chart__line"
|
|
120
|
-
points=${
|
|
149
|
+
points=${i}
|
|
121
150
|
stroke=${t}
|
|
122
|
-
stroke-dasharray=${e.comparison ? "5 4" :
|
|
151
|
+
stroke-dasharray=${e.comparison ? "5 4" : u}
|
|
123
152
|
opacity=${e.comparison ? .9 : 1} />`}
|
|
124
153
|
`;
|
|
125
154
|
})}
|
|
126
155
|
<!-- The line's own shape at its end; a 4 px point there at an early as-of time. -->
|
|
127
|
-
${e.symbol ?
|
|
156
|
+
${e.symbol ? _`<path class="lintje-chart__line-end" d=${j(e.symbol, 4.5, s.x, s.y)} fill=${t} />` : K && !e.comparison ? _`<circle cx=${s.x} cy=${s.y} r="4" fill=${t} />` : u}
|
|
128
157
|
</g>
|
|
129
158
|
`;
|
|
130
159
|
})}
|
|
131
160
|
</g>`,
|
|
132
|
-
|
|
133
|
-
area:
|
|
134
|
-
index:
|
|
135
|
-
count:
|
|
136
|
-
label: `peilmoment ${
|
|
137
|
-
pendingHours:
|
|
161
|
+
K && d ? V({
|
|
162
|
+
area: W,
|
|
163
|
+
index: J,
|
|
164
|
+
count: i.length,
|
|
165
|
+
label: `peilmoment ${d}`,
|
|
166
|
+
pendingHours: f,
|
|
138
167
|
lastValue: (() => {
|
|
139
|
-
let e =
|
|
140
|
-
return e == null ? void 0 : `${
|
|
168
|
+
let e = w.find((e) => !e.comparison)?.values[J];
|
|
169
|
+
return e == null ? void 0 : `${l(e)}${o ? ` ${o}` : ""}`;
|
|
141
170
|
})()
|
|
142
|
-
}) :
|
|
143
|
-
|
|
144
|
-
let t =
|
|
145
|
-
return
|
|
146
|
-
cx=${
|
|
147
|
-
cy=${
|
|
171
|
+
}) : u,
|
|
172
|
+
n.hoverIndex == null ? u : w.map((e) => {
|
|
173
|
+
let t = n.hoverIndex, r = e.values[t];
|
|
174
|
+
return r == null || K && t > J ? u : _`<circle class="lintje-chart__hover-point" r="4" fill=${Y(e)}
|
|
175
|
+
cx=${A(t, i.length, W)}
|
|
176
|
+
cy=${O(r, E, W)} />`;
|
|
148
177
|
}),
|
|
149
|
-
|
|
150
|
-
let
|
|
151
|
-
return
|
|
152
|
-
<rect x=${
|
|
153
|
-
height=${
|
|
178
|
+
i.map((e, t) => {
|
|
179
|
+
let r = A(t, i.length, W), a = D(W) / Math.max(1, i.length - 1);
|
|
180
|
+
return _`
|
|
181
|
+
<rect x=${r - a / 2} y=${W.top} width=${a}
|
|
182
|
+
height=${W.height - W.top - W.bottom}
|
|
154
183
|
fill="transparent"
|
|
155
|
-
@mousemove=${(e) =>
|
|
156
|
-
@mouseleave=${() =>
|
|
184
|
+
@mousemove=${(e) => n.hoverAt(t, e, ce(t))}
|
|
185
|
+
@mouseleave=${() => n.hoverAt(null)} />
|
|
157
186
|
`;
|
|
158
187
|
})
|
|
159
188
|
];
|
|
160
|
-
return
|
|
161
|
-
<div class="lintje-chart-wrap ${
|
|
162
|
-
${
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
189
|
+
return p`
|
|
190
|
+
<div class="lintje-chart-wrap ${v ? "lintje-chart--small" : ""}"
|
|
191
|
+
${s({ "--lintje-event-size": `${$}px` })}
|
|
192
|
+
${m(n.attach)} ?data-in-view=${n.inView} data-tooltip-anchor
|
|
193
|
+
@keydown=${(e) => n.dismiss(e)}>
|
|
194
|
+
${z({
|
|
195
|
+
items: re,
|
|
196
|
+
onToggle: (e) => n.toggleSeries(e)
|
|
167
197
|
})}
|
|
168
|
-
${
|
|
169
|
-
fontFamily:
|
|
170
|
-
id:
|
|
171
|
-
ticks:
|
|
172
|
-
max:
|
|
173
|
-
area:
|
|
174
|
-
formatTick:
|
|
175
|
-
axisTitle:
|
|
176
|
-
xLabels:
|
|
177
|
-
description:
|
|
178
|
-
keys:
|
|
179
|
-
},
|
|
180
|
-
${
|
|
181
|
-
|
|
198
|
+
${ee({
|
|
199
|
+
fontFamily: n.fontFamily,
|
|
200
|
+
id: b,
|
|
201
|
+
ticks: k,
|
|
202
|
+
max: E,
|
|
203
|
+
area: W,
|
|
204
|
+
formatTick: M.format,
|
|
205
|
+
axisTitle: a ?? o,
|
|
206
|
+
xLabels: se,
|
|
207
|
+
description: y.length ? `${r} ${y.map((e) => `Gebeurtenis ${e.number}, ${i[e.index]}: ${e.label}.`).join(" ")}` : r,
|
|
208
|
+
keys: le
|
|
209
|
+
}, ue)}
|
|
210
|
+
${y.length ? p`<ol class="lintje-chart-events" aria-label="Gebeurtenissen">
|
|
211
|
+
${y.map((e) => p`<li class="lintje-chart-events__item">
|
|
212
|
+
<span class="lintje-event-chip"><span class="lintje-event-chip__number">${e.number}</span></span>
|
|
213
|
+
<span><span class="lintje-chart-events__category">${i[e.index]}</span> ·
|
|
214
|
+
${e.label}</span>
|
|
215
|
+
</li>`)}
|
|
216
|
+
</ol>` : u}
|
|
217
|
+
${U(n)}
|
|
218
|
+
${Q(n)}
|
|
182
219
|
</div>
|
|
183
220
|
`;
|
|
184
221
|
}
|
|
185
222
|
//#endregion
|
|
186
223
|
//#region src/components/shared/charts/shared/mark-select.ts
|
|
187
|
-
var
|
|
224
|
+
var ce = {
|
|
188
225
|
clickable: !1,
|
|
189
226
|
state: "",
|
|
190
|
-
markId:
|
|
191
|
-
role:
|
|
192
|
-
tabIndex:
|
|
193
|
-
pressed:
|
|
194
|
-
label:
|
|
195
|
-
click:
|
|
196
|
-
keydown:
|
|
227
|
+
markId: u,
|
|
228
|
+
role: u,
|
|
229
|
+
tabIndex: u,
|
|
230
|
+
pressed: u,
|
|
231
|
+
label: u,
|
|
232
|
+
click: u,
|
|
233
|
+
keydown: u
|
|
197
234
|
};
|
|
198
|
-
function
|
|
235
|
+
function le(e, t) {
|
|
199
236
|
let n = /* @__PURE__ */ new Set();
|
|
200
237
|
for (let e of t) e?.href && n.add(e.id);
|
|
201
238
|
let r = e.selectedId != null && n.has(e.selectedId) ? e.selectedId : null, i = () => {
|
|
@@ -212,8 +249,8 @@ function Q(e, t) {
|
|
|
212
249
|
active: r,
|
|
213
250
|
interactive: !!e.onSelect && n.size > 0,
|
|
214
251
|
of(t, n, i) {
|
|
215
|
-
if (!t?.href || !e.onSelect) return r == null ?
|
|
216
|
-
...
|
|
252
|
+
if (!t?.href || !e.onSelect) return r == null ? ce : {
|
|
253
|
+
...ce,
|
|
217
254
|
state: "is-muted"
|
|
218
255
|
};
|
|
219
256
|
let o = t.id === r;
|
|
@@ -238,304 +275,304 @@ function Q(e, t) {
|
|
|
238
275
|
}
|
|
239
276
|
//#endregion
|
|
240
277
|
//#region src/components/shared/charts/bar-chart/bar-chart.ts
|
|
241
|
-
var
|
|
278
|
+
var ue = [
|
|
242
279
|
"var(--color-chart-tint-1)",
|
|
243
280
|
"var(--color-chart-tint-2)",
|
|
244
281
|
"var(--color-chart-tint-3)",
|
|
245
282
|
"var(--color-chart-tint-4)",
|
|
246
283
|
"var(--color-chart-tint-5)"
|
|
247
284
|
];
|
|
248
|
-
function
|
|
249
|
-
let { controller:
|
|
250
|
-
|
|
285
|
+
function de(e, t) {
|
|
286
|
+
let { controller: n, description: r } = t, { labels: i, values: a, axisTitle: o, trend: d, dataLabels: f = !0, small: h = !1, links: g } = e, y = F(e.color) ?? "var(--color-chart-default)", b = n.id, x = le(t, g ?? []);
|
|
287
|
+
n.measure({
|
|
251
288
|
width: !0,
|
|
252
289
|
height: t.height ?? (h ? "--chart-h-small" : "--chart-h-main"),
|
|
253
290
|
fit: !!t.expanded && !t.mobile
|
|
254
291
|
});
|
|
255
|
-
let S =
|
|
256
|
-
title:
|
|
292
|
+
let S = a.filter((e) => e != null), { max: C, ticks: w } = q(Math.max(...S, 1)), T = N(w, n.width, { fontFamily: n.fontFamily }), E = ne(t, { left: T.width }), D = E.height - E.bottom, { width: A, bandWidth: j } = k(0, i.length, E), M = f && a.every((e) => e == null || c(v(e, A), j - 4)), P = (e) => ({
|
|
293
|
+
title: i[e],
|
|
257
294
|
rows: [{
|
|
258
|
-
label:
|
|
259
|
-
value:
|
|
295
|
+
label: o ?? "Waarde",
|
|
296
|
+
value: a[e] == null ? "geen gegevens" : l(a[e]),
|
|
260
297
|
color: y
|
|
261
298
|
}]
|
|
262
|
-
}),
|
|
263
|
-
x:
|
|
264
|
-
y:
|
|
265
|
-
content:
|
|
266
|
-
})), L = [
|
|
267
|
-
let
|
|
268
|
-
if (e == null) return
|
|
299
|
+
}), I = Z(n, i.length, (e) => ({
|
|
300
|
+
x: k(e, i.length, E).center,
|
|
301
|
+
y: a[e] == null ? E.top : O(a[e], C, E),
|
|
302
|
+
content: P(e)
|
|
303
|
+
})), L = [a.map((e, t) => {
|
|
304
|
+
let r = k(t, i.length, E);
|
|
305
|
+
if (e == null) return _`<rect class="lintje-chart__missing" x=${r.x} y=${E.top} width=${r.width}
|
|
269
306
|
height=${Math.max(0, D - E.top)} fill="url(#hatch-${b})"
|
|
270
|
-
@mousemove=${(e) =>
|
|
271
|
-
@mouseleave=${() =>
|
|
272
|
-
let
|
|
273
|
-
return
|
|
274
|
-
<g class="lintje-chart__bar-group ${
|
|
275
|
-
${
|
|
276
|
-
@mousemove=${(e) =>
|
|
277
|
-
@mouseleave=${() =>
|
|
278
|
-
<rect class="lintje-chart__bar lintje-chart__mark ${
|
|
279
|
-
x=${
|
|
280
|
-
data-mark-id=${
|
|
281
|
-
aria-pressed=${
|
|
282
|
-
@click=${
|
|
283
|
-
${M ?
|
|
284
|
-
${
|
|
285
|
-
</text>` :
|
|
307
|
+
@mousemove=${(e) => n.showTooltip(e, P(t))}
|
|
308
|
+
@mouseleave=${() => n.hideTooltip()} />`;
|
|
309
|
+
let a = O(e, C, E), o = x.of(g?.[t], i[t], `${i[t]}: ${l(e)}`);
|
|
310
|
+
return _`
|
|
311
|
+
<g class="lintje-chart__bar-group ${n.hoverIndex === t ? "is-hovered" : ""}"
|
|
312
|
+
${s(B(t, i.length))}
|
|
313
|
+
@mousemove=${(e) => n.showTooltip(e, P(t))}
|
|
314
|
+
@mouseleave=${() => n.hideTooltip()}>
|
|
315
|
+
<rect class="lintje-chart__bar lintje-chart__mark ${o.state}"
|
|
316
|
+
x=${r.x} y=${a} width=${r.width} height=${Math.max(0, D - a)} fill=${y}
|
|
317
|
+
data-mark-id=${o.markId} role=${o.role} tabindex=${o.tabIndex}
|
|
318
|
+
aria-pressed=${o.pressed} aria-label=${o.label}
|
|
319
|
+
@click=${o.click} @keydown=${o.keydown} />
|
|
320
|
+
${M ? _`<text x=${r.center} y=${a - 5} text-anchor="middle" class="lintje-chart__data-label">
|
|
321
|
+
${v(e, r.width)}
|
|
322
|
+
</text>` : u}
|
|
286
323
|
</g>
|
|
287
324
|
`;
|
|
288
|
-
}), d ?
|
|
325
|
+
}), d ? _`<polyline
|
|
289
326
|
fill="none" stroke="var(--color-chart-emphasis)" stroke-width="1.5" stroke-dasharray="5 4"
|
|
290
|
-
points=${d.map((e, t) => e == null ? null : `${
|
|
291
|
-
return
|
|
327
|
+
points=${d.map((e, t) => e == null ? null : `${k(t, i.length, E).center},${O(e, C, E)}`).filter(Boolean).join(" ")} />` : u];
|
|
328
|
+
return p`
|
|
292
329
|
<div class="lintje-chart-wrap ${h ? "lintje-chart--small" : ""}"
|
|
293
|
-
${
|
|
294
|
-
@keydown=${(e) =>
|
|
295
|
-
${
|
|
296
|
-
fontFamily:
|
|
330
|
+
${m(n.attach)} ?data-in-view=${n.inView} data-tooltip-anchor
|
|
331
|
+
@keydown=${(e) => n.dismiss(e) || x.escape(e)}>
|
|
332
|
+
${ee({
|
|
333
|
+
fontFamily: n.fontFamily,
|
|
297
334
|
id: b,
|
|
298
335
|
ticks: w,
|
|
299
336
|
max: C,
|
|
300
337
|
area: E,
|
|
301
|
-
axisTitle:
|
|
302
|
-
description:
|
|
338
|
+
axisTitle: o,
|
|
339
|
+
description: r,
|
|
303
340
|
formatTick: T.format,
|
|
304
|
-
xLabels:
|
|
341
|
+
xLabels: i.map((e, t) => ({
|
|
305
342
|
label: e,
|
|
306
|
-
x:
|
|
343
|
+
x: k(t, i.length, E).center
|
|
307
344
|
})),
|
|
308
345
|
interactive: x.interactive,
|
|
309
|
-
keys:
|
|
346
|
+
keys: I
|
|
310
347
|
}, L)}
|
|
311
|
-
${
|
|
312
|
-
${
|
|
348
|
+
${U(n)}
|
|
349
|
+
${Q(n)}
|
|
313
350
|
</div>
|
|
314
351
|
`;
|
|
315
352
|
}
|
|
316
353
|
//#endregion
|
|
317
354
|
//#region src/components/shared/charts/horizontal-bar-chart/horizontal-bar-chart.ts
|
|
318
|
-
function
|
|
355
|
+
function fe(e) {
|
|
319
356
|
return e * 26 + 24;
|
|
320
357
|
}
|
|
321
|
-
function
|
|
322
|
-
let { controller:
|
|
358
|
+
function pe(e, t) {
|
|
359
|
+
let { controller: n, description: r } = t, { rows: i, threshold: a, thresholdLabel: o, unit: c } = e, d = F(e.color) ?? "var(--color-chart-dark-yellow)", f = F(e.aboveThresholdColor) ?? "var(--color-chart-red)", h = n.id, g = i.map((e) => e.href ? {
|
|
323
360
|
id: e.id ?? e.label,
|
|
324
361
|
href: e.href
|
|
325
|
-
} : null), v =
|
|
326
|
-
|
|
362
|
+
} : null), v = le(t, g), y = fe(i.length);
|
|
363
|
+
n.measure({
|
|
327
364
|
width: !0,
|
|
328
365
|
height: y
|
|
329
366
|
});
|
|
330
|
-
let b =
|
|
331
|
-
let t =
|
|
367
|
+
let b = n.width, x = K(i.map((e) => e.label), b, { fontFamily: n.fontFamily }), { labelEnd: S, barStart: C } = x, w = Math.max(...i.map((e) => e.value), a ?? 0) * 1.15, T = (e) => Math.max(40, b - C - 60) * e / w, E = (e) => `${l(e)}${c ? ` ${c}` : ""}`, D = (e) => {
|
|
368
|
+
let t = i[e], n = a != null && t.value > a;
|
|
332
369
|
return {
|
|
333
370
|
title: t.label,
|
|
334
371
|
rows: [{
|
|
335
372
|
label: "Waarde",
|
|
336
373
|
value: E(t.value),
|
|
337
374
|
color: n ? f : d
|
|
338
|
-
}, ...
|
|
375
|
+
}, ...a == null ? [] : [{
|
|
339
376
|
label: "Norm",
|
|
340
|
-
value: E(
|
|
377
|
+
value: E(a),
|
|
341
378
|
color: "var(--color-chart-emphasis)"
|
|
342
379
|
}]]
|
|
343
380
|
};
|
|
344
|
-
}, O =
|
|
345
|
-
x: C + T(
|
|
381
|
+
}, O = Z(n, i.length, (e) => ({
|
|
382
|
+
x: C + T(i[e].value),
|
|
346
383
|
y: e * 26 + 4,
|
|
347
384
|
content: D(e)
|
|
348
385
|
}));
|
|
349
|
-
return
|
|
350
|
-
<figure class="lintje-chart lintje-chart--rows" ${
|
|
386
|
+
return p`
|
|
387
|
+
<figure class="lintje-chart lintje-chart--rows" ${m(n.attach)} ?data-in-view=${n.inView}
|
|
351
388
|
data-tooltip-anchor
|
|
352
|
-
@keydown=${(e) =>
|
|
353
|
-
<svg viewBox="0 0 ${b} ${y}" class="lintje-chart__svg" role=${
|
|
354
|
-
aria-labelledby="${
|
|
355
|
-
${
|
|
389
|
+
@keydown=${(e) => n.dismiss(e) || v.escape(e)}>
|
|
390
|
+
<svg viewBox="0 0 ${b} ${y}" class="lintje-chart__svg" role=${R(v.interactive)}
|
|
391
|
+
aria-labelledby="${h}-desc" width=${b} height=${y}
|
|
392
|
+
${s({
|
|
356
393
|
height: `${y}px`,
|
|
357
|
-
...
|
|
394
|
+
...M(h)
|
|
358
395
|
})}
|
|
359
396
|
tabindex="0" @keydown=${O.keydown} @focus=${O.focus} @blur=${O.blur}>
|
|
360
|
-
<desc id="${
|
|
361
|
-
<defs>${
|
|
362
|
-
${
|
|
363
|
-
<line x1=${C + T(
|
|
397
|
+
<desc id="${h}-desc">${r}</desc>
|
|
398
|
+
<defs>${P(h)}</defs>
|
|
399
|
+
${a == null ? u : _`
|
|
400
|
+
<line x1=${C + T(a)} x2=${C + T(a)} y1=${4} y2=${i.length * 26 + 2}
|
|
364
401
|
stroke="var(--color-chart-emphasis)" stroke-width="1" stroke-dasharray="3 3" />
|
|
365
|
-
<text x=${C + T(
|
|
366
|
-
${
|
|
402
|
+
<text x=${C + T(a) + 6} y=${i.length * 26 + 16} class="lintje-chart__axis-label">
|
|
403
|
+
${o ?? `norm ${l(a)}`}
|
|
367
404
|
</text>
|
|
368
405
|
`}
|
|
369
|
-
${
|
|
370
|
-
let
|
|
371
|
-
return
|
|
372
|
-
<g class="lintje-chart__bar-row ${
|
|
373
|
-
@mousemove=${(e) =>
|
|
374
|
-
@mouseleave=${() =>
|
|
406
|
+
${i.map((e, t) => {
|
|
407
|
+
let r = t * 26 + 4, o = a != null && e.value > a, u = T(e.value), p = v.of(g[t], e.label, `${e.label}: ${l(e.value)}${c ? ` ${c}` : ""}`);
|
|
408
|
+
return _`
|
|
409
|
+
<g class="lintje-chart__bar-row ${n.hoverIndex === t ? "is-hovered" : ""}"
|
|
410
|
+
@mousemove=${(e) => n.showTooltip(e, D(t))}
|
|
411
|
+
@mouseleave=${() => n.hideTooltip()}>
|
|
375
412
|
<!-- Hit area across the whole row, so the tooltip doesn't flicker between bars. -->
|
|
376
|
-
<rect x=${0} y=${
|
|
377
|
-
<text x=${S} y=${
|
|
378
|
-
<rect class="lintje-chart__bar lintje-chart__bar--horizontal lintje-chart__mark ${
|
|
379
|
-
${
|
|
380
|
-
x=${C} y=${
|
|
381
|
-
fill=${
|
|
382
|
-
data-mark-id=${
|
|
383
|
-
aria-pressed=${
|
|
384
|
-
@click=${
|
|
385
|
-
<text x=${C +
|
|
386
|
-
class="lintje-chart__data-label ${
|
|
387
|
-
${
|
|
413
|
+
<rect x=${0} y=${r - 5} width=${b} height=${26} fill="transparent" />
|
|
414
|
+
<text x=${S} y=${r + 16 - 3} text-anchor="end" class="lintje-chart__axis-label">${x.fit(e.label)}</text>
|
|
415
|
+
<rect class="lintje-chart__bar lintje-chart__bar--horizontal lintje-chart__mark ${p.state}"
|
|
416
|
+
${s(B(t, i.length))}
|
|
417
|
+
x=${C} y=${r} width=${Math.max(0, u)} height=${16}
|
|
418
|
+
fill=${o ? f : d}
|
|
419
|
+
data-mark-id=${p.markId} role=${p.role} tabindex=${p.tabIndex}
|
|
420
|
+
aria-pressed=${p.pressed} aria-label=${p.label}
|
|
421
|
+
@click=${p.click} @keydown=${p.keydown} />
|
|
422
|
+
<text x=${C + u + 6} y=${r + 16 - 3} font-weight="700"
|
|
423
|
+
class="lintje-chart__data-label ${a == null ? "" : "lintje-chart__data-label--halo"}">
|
|
424
|
+
${l(e.value)}${c ? ` ${c}` : ""}
|
|
388
425
|
</text>
|
|
389
426
|
</g>
|
|
390
427
|
`;
|
|
391
428
|
})}
|
|
392
429
|
</svg>
|
|
393
|
-
${
|
|
394
|
-
${
|
|
430
|
+
${U(n)}
|
|
431
|
+
${Q(n)}
|
|
395
432
|
</figure>
|
|
396
433
|
`;
|
|
397
434
|
}
|
|
398
435
|
//#endregion
|
|
399
436
|
//#region src/components/shared/charts/target-progress-chart/target-progress-chart.ts
|
|
400
|
-
function
|
|
401
|
-
let { controller: n, description: r } = t, { rows:
|
|
437
|
+
function me(e, t) {
|
|
438
|
+
let { controller: n, description: r } = t, { rows: i, target: a = 100 } = e, o = n.id, c = fe(i.length);
|
|
402
439
|
n.measure({
|
|
403
440
|
width: !0,
|
|
404
|
-
height:
|
|
441
|
+
height: c
|
|
405
442
|
});
|
|
406
|
-
let
|
|
407
|
-
title:
|
|
443
|
+
let l = n.width, u = K(i.map((e) => e.label), l, { fontFamily: n.fontFamily }), { labelEnd: f, barStart: h } = u, g = (e) => Math.max(40, l - h - 70) * e / 110, v = h + g(a), y = (e) => e >= a ? "var(--color-chart-green)" : "var(--color-attention)", b = (e) => ({
|
|
444
|
+
title: i[e].label,
|
|
408
445
|
rows: [{
|
|
409
446
|
label: "Voortgang",
|
|
410
|
-
value:
|
|
411
|
-
color: y(
|
|
447
|
+
value: d(i[e].value),
|
|
448
|
+
color: y(i[e].value)
|
|
412
449
|
}, {
|
|
413
450
|
label: "Doel",
|
|
414
|
-
value:
|
|
451
|
+
value: d(a),
|
|
415
452
|
color: "var(--color-chart-emphasis)"
|
|
416
453
|
}]
|
|
417
|
-
}), x =
|
|
418
|
-
x: h + g(
|
|
454
|
+
}), x = Z(n, i.length, (e) => ({
|
|
455
|
+
x: h + g(i[e].value),
|
|
419
456
|
y: e * 26 + 4,
|
|
420
457
|
content: b(e)
|
|
421
458
|
}));
|
|
422
|
-
return
|
|
423
|
-
<figure class="lintje-chart lintje-chart--rows" ${
|
|
459
|
+
return p`
|
|
460
|
+
<figure class="lintje-chart lintje-chart--rows" ${m(n.attach)} ?data-in-view=${n.inView}
|
|
424
461
|
data-tooltip-anchor @keydown=${(e) => n.dismiss(e)}>
|
|
425
|
-
<svg viewBox="0 0 ${
|
|
426
|
-
aria-labelledby="${
|
|
462
|
+
<svg viewBox="0 0 ${l} ${c}" class="lintje-chart__svg" role="img"
|
|
463
|
+
aria-labelledby="${o}-desc" width=${l} height=${c} ${s({ height: `${c}px` })}
|
|
427
464
|
tabindex="0" @keydown=${x.keydown} @focus=${x.focus} @blur=${x.blur}>
|
|
428
|
-
<desc id="${
|
|
429
|
-
${
|
|
430
|
-
let r = t * 26 + 4,
|
|
431
|
-
return
|
|
465
|
+
<desc id="${o}-desc">${r}</desc>
|
|
466
|
+
${i.map((e, t) => {
|
|
467
|
+
let r = t * 26 + 4, o = g(e.value), c = y(e.value), p = h + o + 46 > l, m = e.value >= a ? "lintje-chart__data-label--inside" : "lintje-chart__data-label--inside-light";
|
|
468
|
+
return _`
|
|
432
469
|
<g class="lintje-chart__bar-row ${n.hoverIndex === t ? "is-hovered" : ""}"
|
|
433
470
|
@mousemove=${(e) => n.showTooltip(e, b(t))}
|
|
434
471
|
@mouseleave=${() => n.hideTooltip()}>
|
|
435
|
-
<rect x=${0} y=${r - 5} width=${
|
|
436
|
-
<text x=${
|
|
437
|
-
<rect class="lintje-chart__bar lintje-chart__bar--horizontal" ${
|
|
438
|
-
x=${h} y=${r} width=${Math.max(0,
|
|
439
|
-
<text x=${
|
|
440
|
-
text-anchor=${
|
|
441
|
-
class="lintje-chart__data-label ${
|
|
472
|
+
<rect x=${0} y=${r - 5} width=${l} height=${26} fill="transparent" />
|
|
473
|
+
<text x=${f} y=${r + 16 - 3} text-anchor="end" class="lintje-chart__axis-label">${u.fit(e.label)}</text>
|
|
474
|
+
<rect class="lintje-chart__bar lintje-chart__bar--horizontal" ${s(B(t, i.length))}
|
|
475
|
+
x=${h} y=${r} width=${Math.max(0, o)} height=${16} fill=${c} />
|
|
476
|
+
<text x=${p ? h + o - 6 : h + o + 6} y=${r + 16 - 3}
|
|
477
|
+
text-anchor=${p ? "end" : "start"}
|
|
478
|
+
class="lintje-chart__data-label ${p ? m : ""}" font-weight="700">${d(e.value)}</text>
|
|
442
479
|
</g>
|
|
443
480
|
`;
|
|
444
481
|
})}
|
|
445
|
-
<line x1=${v} x2=${v} y1=${0} y2=${
|
|
482
|
+
<line x1=${v} x2=${v} y1=${0} y2=${i.length * 26 + 2}
|
|
446
483
|
stroke="var(--color-chart-emphasis)" stroke-width="1" stroke-dasharray="3 3" />
|
|
447
|
-
<text x=${v + 6} y=${
|
|
484
|
+
<text x=${v + 6} y=${i.length * 26 + 16} class="lintje-chart__axis-label">norm ${a}</text>
|
|
448
485
|
</svg>
|
|
449
|
-
${
|
|
450
|
-
${
|
|
486
|
+
${U(n)}
|
|
487
|
+
${Q(n)}
|
|
451
488
|
</figure>
|
|
452
489
|
`;
|
|
453
490
|
}
|
|
454
491
|
//#endregion
|
|
455
492
|
//#region src/components/shared/charts/grouped-bar-chart/grouped-bar-chart.ts
|
|
456
|
-
function
|
|
457
|
-
let { controller:
|
|
458
|
-
|
|
493
|
+
function he(e, t) {
|
|
494
|
+
let { controller: n, description: r } = t, { labels: i, axisTitle: a, small: o = !1 } = e, d = n.id;
|
|
495
|
+
n.measure({
|
|
459
496
|
width: !0,
|
|
460
|
-
height: t.height ?? (
|
|
497
|
+
height: t.height ?? (o ? "--chart-h-small" : "--chart-h-main"),
|
|
461
498
|
fit: !!t.expanded && !t.mobile
|
|
462
499
|
});
|
|
463
|
-
let
|
|
500
|
+
let f = e.series.map((e) => ({
|
|
464
501
|
...e,
|
|
465
|
-
color:
|
|
466
|
-
})), h =
|
|
502
|
+
color: F(e.color)
|
|
503
|
+
})), h = f.filter((e) => !n.hiddenSeries.includes(e.label)), g = le(t, h.flatMap((e) => e.links ?? [])), { max: y, ticks: b } = q(Math.max(...h.flatMap((e) => e.values), 1)), x = N(b, n.width, { fontFamily: n.fontFamily }), S = ne(t, { left: x.width }), C = S.height - S.bottom, w = k(0, i.length, S).width / Math.max(1, h.length), T = h.every((e) => e.values.every((e) => c(v(e, w), w - 2))), E = f.map((e, t) => ({
|
|
467
504
|
label: e.label,
|
|
468
505
|
color: e.color ?? (t === 0 ? "var(--color-chart-default)" : "var(--color-chart-secondary)"),
|
|
469
506
|
shape: "square",
|
|
470
|
-
hidden:
|
|
471
|
-
})), D = (e, t) => E[
|
|
472
|
-
title:
|
|
507
|
+
hidden: n.hiddenSeries.includes(e.label)
|
|
508
|
+
})), D = (e, t) => E[f.indexOf(e)]?.color ?? ue[t], A = (e) => ({
|
|
509
|
+
title: i[e],
|
|
473
510
|
rows: h.map((t, n) => ({
|
|
474
511
|
label: t.label,
|
|
475
|
-
value:
|
|
512
|
+
value: l(t.values[e]),
|
|
476
513
|
color: D(t, n)
|
|
477
514
|
}))
|
|
478
|
-
}), j =
|
|
479
|
-
x:
|
|
480
|
-
y:
|
|
481
|
-
content:
|
|
482
|
-
})), M =
|
|
483
|
-
let
|
|
484
|
-
return
|
|
485
|
-
<g class="lintje-chart__bar-group ${
|
|
486
|
-
${
|
|
487
|
-
@mousemove=${(e) =>
|
|
488
|
-
@mouseleave=${() =>
|
|
489
|
-
${h.map((
|
|
490
|
-
let
|
|
491
|
-
return
|
|
515
|
+
}), j = Z(n, i.length, (e) => ({
|
|
516
|
+
x: k(e, i.length, S).center,
|
|
517
|
+
y: O(Math.max(0, ...h.map((t) => t.values[e])), y, S),
|
|
518
|
+
content: A(e)
|
|
519
|
+
})), M = i.map((e, t) => {
|
|
520
|
+
let r = k(t, i.length, S);
|
|
521
|
+
return _`
|
|
522
|
+
<g class="lintje-chart__bar-group ${n.hoverIndex === t ? "is-hovered" : ""}"
|
|
523
|
+
${s(B(t, i.length))}
|
|
524
|
+
@mousemove=${(e) => n.showTooltip(e, A(t))}
|
|
525
|
+
@mouseleave=${() => n.hideTooltip()}>
|
|
526
|
+
${h.map((n, i) => {
|
|
527
|
+
let a = n.values[t], o = O(a, y, S), s = D(n, i), c = g.of(n.links?.[t], `${e} · ${n.label}`, `${e}, ${n.label}: ${l(a)}`);
|
|
528
|
+
return _`
|
|
492
529
|
<g>
|
|
493
|
-
<rect class="lintje-chart__bar lintje-chart__mark ${
|
|
494
|
-
x=${
|
|
495
|
-
height=${Math.max(0, C -
|
|
496
|
-
data-mark-id=${
|
|
497
|
-
aria-pressed=${
|
|
498
|
-
@click=${
|
|
499
|
-
${T ?
|
|
500
|
-
text-anchor="middle" class="lintje-chart__data-label">${
|
|
530
|
+
<rect class="lintje-chart__bar lintje-chart__mark ${c.state}"
|
|
531
|
+
x=${r.x + i * w} y=${o} width=${w - 2}
|
|
532
|
+
height=${Math.max(0, C - o)} fill=${s}
|
|
533
|
+
data-mark-id=${c.markId} role=${c.role} tabindex=${c.tabIndex}
|
|
534
|
+
aria-pressed=${c.pressed} aria-label=${c.label}
|
|
535
|
+
@click=${c.click} @keydown=${c.keydown} />
|
|
536
|
+
${T ? _`<text x=${r.x + i * w + (w - 2) / 2} y=${o - 4}
|
|
537
|
+
text-anchor="middle" class="lintje-chart__data-label">${v(a, w)}</text>` : u}
|
|
501
538
|
</g>
|
|
502
539
|
`;
|
|
503
540
|
})}
|
|
504
541
|
</g>
|
|
505
542
|
`;
|
|
506
543
|
});
|
|
507
|
-
return
|
|
508
|
-
<div class="lintje-chart-wrap ${
|
|
509
|
-
${
|
|
510
|
-
@keydown=${(e) =>
|
|
511
|
-
${
|
|
544
|
+
return p`
|
|
545
|
+
<div class="lintje-chart-wrap ${o ? "lintje-chart--small" : ""}"
|
|
546
|
+
${m(n.attach)} ?data-in-view=${n.inView} data-tooltip-anchor
|
|
547
|
+
@keydown=${(e) => n.dismiss(e) || g.escape(e)}>
|
|
548
|
+
${z({
|
|
512
549
|
items: E,
|
|
513
|
-
onToggle: (e) =>
|
|
550
|
+
onToggle: (e) => n.toggleSeries(e)
|
|
514
551
|
})}
|
|
515
|
-
${
|
|
516
|
-
fontFamily:
|
|
552
|
+
${ee({
|
|
553
|
+
fontFamily: n.fontFamily,
|
|
517
554
|
id: d,
|
|
518
555
|
ticks: b,
|
|
519
556
|
max: y,
|
|
520
557
|
area: S,
|
|
521
|
-
axisTitle:
|
|
522
|
-
description:
|
|
558
|
+
axisTitle: a,
|
|
559
|
+
description: r,
|
|
523
560
|
formatTick: x.format,
|
|
524
|
-
xLabels:
|
|
561
|
+
xLabels: i.map((e, t) => ({
|
|
525
562
|
label: e,
|
|
526
|
-
x:
|
|
563
|
+
x: k(t, i.length, S).center
|
|
527
564
|
})),
|
|
528
|
-
interactive:
|
|
565
|
+
interactive: g.interactive,
|
|
529
566
|
keys: j
|
|
530
567
|
}, M)}
|
|
531
|
-
${
|
|
532
|
-
${
|
|
568
|
+
${U(n)}
|
|
569
|
+
${Q(n)}
|
|
533
570
|
</div>
|
|
534
571
|
`;
|
|
535
572
|
}
|
|
536
573
|
//#endregion
|
|
537
574
|
//#region src/components/shared/charts/shared/tints.ts
|
|
538
|
-
var
|
|
575
|
+
var ge = [
|
|
539
576
|
[1],
|
|
540
577
|
[1, 4],
|
|
541
578
|
[
|
|
@@ -557,14 +594,14 @@ var $ = [
|
|
|
557
594
|
5
|
|
558
595
|
]
|
|
559
596
|
];
|
|
560
|
-
function
|
|
597
|
+
function _e(e, t) {
|
|
561
598
|
if (e < 1) return [];
|
|
562
|
-
let n =
|
|
563
|
-
return
|
|
599
|
+
let n = ge[Math.min(e, ge.length) - 1];
|
|
600
|
+
return g(t) ? n.map((e) => e === 1 ? `var(--color-chart-${t})` : `var(--color-chart-${t}-tint-${e})`) : n.map((e) => `var(--color-chart-tint-${e})`);
|
|
564
601
|
}
|
|
565
602
|
//#endregion
|
|
566
603
|
//#region src/components/shared/charts/stacked-bar-chart/stacked-bar-chart.ts
|
|
567
|
-
var
|
|
604
|
+
var ve = /* @__PURE__ */ new Set([
|
|
568
605
|
"sky-blue",
|
|
569
606
|
"red",
|
|
570
607
|
"green",
|
|
@@ -577,17 +614,17 @@ var he = /* @__PURE__ */ new Set([
|
|
|
577
614
|
"dark-blue",
|
|
578
615
|
"moss-green"
|
|
579
616
|
]);
|
|
580
|
-
function
|
|
581
|
-
let { controller:
|
|
582
|
-
|
|
617
|
+
function ye(e, t) {
|
|
618
|
+
let { controller: n, description: r } = t, { labels: i, axisTitle: a, normalized: o = !1, totalOnTop: f = !0, small: h = !1 } = e, g = n.id;
|
|
619
|
+
n.measure({
|
|
583
620
|
width: !0,
|
|
584
621
|
height: t.height ?? (h ? "--chart-h-small" : "--chart-h-main"),
|
|
585
622
|
fit: !!t.expanded && !t.mobile
|
|
586
623
|
});
|
|
587
624
|
let y = e.series.map((e) => ({
|
|
588
625
|
...e,
|
|
589
|
-
color:
|
|
590
|
-
})), b =
|
|
626
|
+
color: F(e.color)
|
|
627
|
+
})), b = le(t, y.flatMap((e) => e.links ?? [])), x = i.map((e, t) => y.reduce((e, n) => e + n.values[t], 0)), { max: S, ticks: C } = o ? {
|
|
591
628
|
max: 100,
|
|
592
629
|
ticks: [
|
|
593
630
|
0,
|
|
@@ -596,103 +633,295 @@ function ge(e, t) {
|
|
|
596
633
|
75,
|
|
597
634
|
100
|
|
598
635
|
]
|
|
599
|
-
} :
|
|
636
|
+
} : q(Math.max(...x, 1)), w = N(C, n.width, { fontFamily: n.fontFamily }), T = ne(t, { left: w.width }), E = T.height - T.bottom, { width: D, bandWidth: A } = k(0, i.length, T), j = f && !o && x.every((e) => c(v(e, A), A - 4)), M = _e(y.length), P = (e, t) => e.color ?? M[Math.min(t, M.length - 1)], I = (t) => {
|
|
600
637
|
let n = e.series[t].color;
|
|
601
|
-
return (n == null ? t === 0 :
|
|
638
|
+
return (n == null ? t === 0 : ve.has(n)) ? "lintje-chart__data-label--inside" : "lintje-chart__data-label--inside-light";
|
|
602
639
|
}, L = (e) => ({
|
|
603
|
-
title:
|
|
640
|
+
title: i[e],
|
|
604
641
|
rows: y.map((t, n) => ({
|
|
605
642
|
label: t.label,
|
|
606
|
-
value:
|
|
607
|
-
color:
|
|
643
|
+
value: o ? d(t.values[e] / x[e] * 100) : l(t.values[e]),
|
|
644
|
+
color: P(t, n)
|
|
608
645
|
}))
|
|
609
|
-
}), R =
|
|
610
|
-
x:
|
|
611
|
-
y:
|
|
646
|
+
}), R = Z(n, i.length, (e) => ({
|
|
647
|
+
x: k(e, i.length, T).center,
|
|
648
|
+
y: O(o ? S : x[e], S, T),
|
|
612
649
|
content: L(e)
|
|
613
|
-
})),
|
|
650
|
+
})), V = y.map((e, t) => ({
|
|
614
651
|
label: e.label,
|
|
615
|
-
color:
|
|
652
|
+
color: P(e, t),
|
|
616
653
|
shape: "square"
|
|
617
|
-
})),
|
|
618
|
-
let
|
|
619
|
-
let r = e.values[t], i =
|
|
620
|
-
|
|
621
|
-
let
|
|
654
|
+
})), H = i.map((e, t) => {
|
|
655
|
+
let r = k(t, i.length, T), a = 0, f = y.map((e, n) => {
|
|
656
|
+
let r = e.values[t], i = o ? r / x[t] * 100 : r, s = O(a, S, T);
|
|
657
|
+
a += i;
|
|
658
|
+
let c = O(a, S, T);
|
|
622
659
|
return {
|
|
623
660
|
row: e,
|
|
624
661
|
j: n,
|
|
625
662
|
value: i,
|
|
626
|
-
y1:
|
|
627
|
-
height: Math.max(0,
|
|
663
|
+
y1: c,
|
|
664
|
+
height: Math.max(0, s - c)
|
|
628
665
|
};
|
|
629
666
|
});
|
|
630
|
-
return
|
|
631
|
-
<g class="lintje-chart__bar-group ${
|
|
632
|
-
${
|
|
633
|
-
@mousemove=${(e) =>
|
|
634
|
-
@mouseleave=${() =>
|
|
667
|
+
return _`
|
|
668
|
+
<g class="lintje-chart__bar-group ${n.hoverIndex === t ? "is-hovered" : ""}"
|
|
669
|
+
${s(B(t, i.length))}
|
|
670
|
+
@mousemove=${(e) => n.showTooltip(e, L(t))}
|
|
671
|
+
@mouseleave=${() => n.hideTooltip()}>
|
|
635
672
|
<!-- The hit area under the whole column, so the tooltip also follows the empty
|
|
636
673
|
space above the stack. It lies *under* the segments: on top it swallowed
|
|
637
674
|
every click on a segment that drills. -->
|
|
638
|
-
<rect x=${
|
|
675
|
+
<rect x=${r.x} y=${T.top} width=${r.width} height=${E - T.top} fill="transparent" />
|
|
639
676
|
<!-- The segments in one group, so the column lifts on hover as a whole. -->
|
|
640
677
|
<g class="lintje-chart__bar">
|
|
641
|
-
${
|
|
642
|
-
let
|
|
643
|
-
return
|
|
644
|
-
<rect class="lintje-chart__mark lintje-chart__segment ${
|
|
645
|
-
x=${
|
|
646
|
-
fill=${
|
|
647
|
-
data-mark-id=${
|
|
648
|
-
aria-pressed=${
|
|
649
|
-
@click=${
|
|
678
|
+
${f.map((n) => {
|
|
679
|
+
let i = b.of(n.row.links?.[t], `${e} · ${n.row.label}`, `${e}, ${n.row.label}: ${l(n.row.values[t])}`);
|
|
680
|
+
return _`
|
|
681
|
+
<rect class="lintje-chart__mark lintje-chart__segment ${i.state}"
|
|
682
|
+
x=${r.x} y=${n.y1} width=${r.width} height=${n.height}
|
|
683
|
+
fill=${P(n.row, n.j)}
|
|
684
|
+
data-mark-id=${i.markId} role=${i.role} tabindex=${i.tabIndex}
|
|
685
|
+
aria-pressed=${i.pressed} aria-label=${i.label}
|
|
686
|
+
@click=${i.click} @keydown=${i.keydown} />
|
|
650
687
|
`;
|
|
651
688
|
})}
|
|
652
689
|
</g>
|
|
653
690
|
<!-- Percentages inside the segments when they are >= 16 px tall and fit the width. -->
|
|
654
|
-
${
|
|
655
|
-
class="lintje-chart__data-label ${
|
|
656
|
-
${j ?
|
|
657
|
-
class="lintje-chart__data-label" font-weight="700">${
|
|
691
|
+
${o ? f.map((e) => e.height >= 16 && c(d(e.value), D - 4) ? _`<text x=${r.center} y=${e.y1 + e.height / 2 + 4} text-anchor="middle"
|
|
692
|
+
class="lintje-chart__data-label ${I(e.j)}">${d(e.value)}</text>` : u) : u}
|
|
693
|
+
${j ? _`<text x=${r.center} y=${O(x[t], S, T) - 5} text-anchor="middle"
|
|
694
|
+
class="lintje-chart__data-label" font-weight="700">${v(x[t], r.bandWidth)}</text>` : u}
|
|
658
695
|
</g>
|
|
659
696
|
`;
|
|
660
697
|
});
|
|
661
|
-
return
|
|
698
|
+
return p`
|
|
662
699
|
<div class="lintje-chart-wrap ${h ? "lintje-chart--small" : ""}"
|
|
663
|
-
${
|
|
664
|
-
@keydown=${(e) =>
|
|
665
|
-
${
|
|
666
|
-
${
|
|
667
|
-
fontFamily:
|
|
668
|
-
id:
|
|
700
|
+
${m(n.attach)} ?data-in-view=${n.inView} data-tooltip-anchor
|
|
701
|
+
@keydown=${(e) => n.dismiss(e) || b.escape(e)}>
|
|
702
|
+
${z({ items: V })}
|
|
703
|
+
${ee({
|
|
704
|
+
fontFamily: n.fontFamily,
|
|
705
|
+
id: g,
|
|
669
706
|
ticks: C,
|
|
670
707
|
max: S,
|
|
671
708
|
area: T,
|
|
672
|
-
axisTitle:
|
|
673
|
-
description:
|
|
709
|
+
axisTitle: a,
|
|
710
|
+
description: r,
|
|
674
711
|
formatTick: w.format,
|
|
675
|
-
xLabels:
|
|
712
|
+
xLabels: i.map((e, t) => ({
|
|
676
713
|
label: e,
|
|
677
|
-
x:
|
|
714
|
+
x: k(t, i.length, T).center
|
|
678
715
|
})),
|
|
679
716
|
interactive: b.interactive,
|
|
680
717
|
keys: R
|
|
681
|
-
},
|
|
682
|
-
${
|
|
683
|
-
${
|
|
718
|
+
}, H)}
|
|
719
|
+
${U(n)}
|
|
720
|
+
${Q(n)}
|
|
721
|
+
</div>
|
|
722
|
+
`;
|
|
723
|
+
}
|
|
724
|
+
//#endregion
|
|
725
|
+
//#region src/components/shared/charts/stacked-area-chart/stacked-area-chart.ts
|
|
726
|
+
var be = "geen gegevens", xe = /* @__PURE__ */ new WeakMap();
|
|
727
|
+
function Se(e, t) {
|
|
728
|
+
return e.duration > 0 ? Math.min(1, (t - e.start) / e.duration) : 1;
|
|
729
|
+
}
|
|
730
|
+
function Ce(e, t) {
|
|
731
|
+
let n = Se(e, t);
|
|
732
|
+
if (n >= 1) return e.to;
|
|
733
|
+
let r = e.ease(n);
|
|
734
|
+
return e.to.map((t, n) => e.from[n] + (t - e.from[n]) * r);
|
|
735
|
+
}
|
|
736
|
+
function we(e, t, n) {
|
|
737
|
+
let r = performance.now(), i = xe.get(e);
|
|
738
|
+
if (!i || i.key !== t) {
|
|
739
|
+
let a = {
|
|
740
|
+
key: t,
|
|
741
|
+
from: n,
|
|
742
|
+
to: n,
|
|
743
|
+
start: r,
|
|
744
|
+
duration: 0,
|
|
745
|
+
ease: (e) => e,
|
|
746
|
+
element: i?.element,
|
|
747
|
+
attach: (e) => {
|
|
748
|
+
a.element = e;
|
|
749
|
+
}
|
|
750
|
+
};
|
|
751
|
+
return xe.set(e, a), n;
|
|
752
|
+
}
|
|
753
|
+
if (i.to.some((e, t) => e !== n[t])) {
|
|
754
|
+
let t = i.element, a = !t || b();
|
|
755
|
+
if (i.from = a ? n : Ce(i, r), i.to = n, i.start = r, i.duration = a ? 0 : o(t, "--dur-layer"), i.ease = t ? y(t, "--ease-in-motion") : (e) => e, i.frame == null && i.duration > 0) {
|
|
756
|
+
let t = i, n = () => {
|
|
757
|
+
t.frame = void 0;
|
|
758
|
+
let r = Se(t, performance.now()) >= 1;
|
|
759
|
+
e.requestUpdate(), r || (t.frame = requestAnimationFrame(n));
|
|
760
|
+
};
|
|
761
|
+
t.frame = requestAnimationFrame(n);
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
return Ce(i, r);
|
|
765
|
+
}
|
|
766
|
+
function Te(e, t) {
|
|
767
|
+
let { controller: n, description: r } = t, { labels: i, axisTitle: a, unit: o, small: s = !1 } = e, c = n.id, d = i.length;
|
|
768
|
+
n.measure({
|
|
769
|
+
width: !0,
|
|
770
|
+
height: t.height ?? (s ? "--chart-h-small" : "--chart-h-main"),
|
|
771
|
+
fit: !!t.expanded && !t.mobile
|
|
772
|
+
});
|
|
773
|
+
let f = _e(e.series.length, e.color), g = e.series.map((e, t) => ({
|
|
774
|
+
...e,
|
|
775
|
+
color: f[Math.min(t, f.length - 1)],
|
|
776
|
+
hidden: n.hiddenSeries.includes(e.label)
|
|
777
|
+
})), v = g.filter((e) => !e.hidden), y = we(n, g.map((e) => e.label).join("\0"), g.map((e) => +!e.hidden)), b = y.some((e, t) => e !== +!g[t].hidden), x = xe.get(n), S = g.map(() => i.map(() => !1)), C = g.map(() => i.map(() => 0)), w = g.map(() => i.map(() => 0)), T = i.map(() => !1);
|
|
778
|
+
i.forEach((e, t) => {
|
|
779
|
+
let n = 0;
|
|
780
|
+
g.forEach((e, r) => {
|
|
781
|
+
if (y[r] === 0) return;
|
|
782
|
+
let i = e.values[t];
|
|
783
|
+
T[t] || i == null ? T[t] = !0 : (S[r][t] = !0, C[r][t] = n, n += i * y[r], w[r][t] = n);
|
|
784
|
+
});
|
|
785
|
+
});
|
|
786
|
+
let E = y.some((e) => e > 0), k = i.map((e, t) => g.map((e) => e.values[t]).filter((e) => e != null)).filter((e) => e.length > 0).map((e) => e.reduce((e, t) => e + t, 0)), { max: j, ticks: M } = q(Math.max(...k, 1)), P = N(M, n.width, {
|
|
787
|
+
fontFamily: n.fontFamily,
|
|
788
|
+
minimum: Math.ceil(h(i[0] ?? "", n.fontFamily) / 2)
|
|
789
|
+
}), F = ne(t, { left: P.width }), I = F.height - F.bottom, L = (e) => A(e, d, F), R = (e) => O(e, j, F), B = (e) => {
|
|
790
|
+
let t = [];
|
|
791
|
+
return i.forEach((n, r) => {
|
|
792
|
+
if (!e(r)) return;
|
|
793
|
+
let i = t[t.length - 1];
|
|
794
|
+
i && i[i.length - 1] === r - 1 ? i.push(r) : t.push([r]);
|
|
795
|
+
}), t;
|
|
796
|
+
}, V = i.map((e, t) => {
|
|
797
|
+
let n = 0;
|
|
798
|
+
for (let e of v) {
|
|
799
|
+
let r = e.values[t];
|
|
800
|
+
if (r == null) return {
|
|
801
|
+
level: n,
|
|
802
|
+
complete: !1
|
|
803
|
+
};
|
|
804
|
+
n += r;
|
|
805
|
+
}
|
|
806
|
+
return {
|
|
807
|
+
level: n,
|
|
808
|
+
complete: v.length > 0
|
|
809
|
+
};
|
|
810
|
+
}), H = g.map((e) => ({
|
|
811
|
+
label: e.label,
|
|
812
|
+
color: e.color,
|
|
813
|
+
shape: "square",
|
|
814
|
+
hidden: e.hidden
|
|
815
|
+
})), te = Math.max(1, Math.ceil(d / 8)), W = i.map((e, t) => ({
|
|
816
|
+
label: e,
|
|
817
|
+
x: L(t),
|
|
818
|
+
i: t
|
|
819
|
+
})).filter((e) => e.i % te === 0), G = v.length < g.length ? "Totaal getoond" : "Totaal";
|
|
820
|
+
function K(e) {
|
|
821
|
+
return {
|
|
822
|
+
title: i[e],
|
|
823
|
+
rows: [...[...v].reverse().map((t) => ({
|
|
824
|
+
label: t.label,
|
|
825
|
+
value: t.values[e] == null ? be : l(t.values[e]),
|
|
826
|
+
color: t.color
|
|
827
|
+
})), ...v.length > 0 ? [{
|
|
828
|
+
label: G,
|
|
829
|
+
value: V[e].complete ? l(V[e].level) : be,
|
|
830
|
+
divider: !0
|
|
831
|
+
}] : []]
|
|
832
|
+
};
|
|
833
|
+
}
|
|
834
|
+
let J = Z(n, d, (e) => ({
|
|
835
|
+
x: L(e),
|
|
836
|
+
y: V[e].level > 0 ? R(V[e].level) : F.top,
|
|
837
|
+
content: K(e)
|
|
838
|
+
})), Y = (e) => {
|
|
839
|
+
let t = [0, 0];
|
|
840
|
+
return g.forEach((n, r) => {
|
|
841
|
+
S[r][e] && S[r][e + 1] && (t = [w[r][e], w[r][e + 1]]);
|
|
842
|
+
}), t;
|
|
843
|
+
}, re = (E ? B((e) => T[e]) : []).map((e) => {
|
|
844
|
+
let t = Math.max(0, e[0] - 1), r = Math.min(d - 1, e[e.length - 1] + 1), i = Array.from({ length: r - t }, (e, n) => t + n).map((e) => {
|
|
845
|
+
let [t, n] = Y(e);
|
|
846
|
+
return {
|
|
847
|
+
k: e,
|
|
848
|
+
left: R(t),
|
|
849
|
+
right: R(n)
|
|
850
|
+
};
|
|
851
|
+
}), a = L(t), o = L(r) - a, s = Math.min(I, ...i.flatMap((e) => [e.left, e.right]));
|
|
852
|
+
return {
|
|
853
|
+
segments: i,
|
|
854
|
+
from: a,
|
|
855
|
+
width: o,
|
|
856
|
+
ceiling: s,
|
|
857
|
+
fits: h(be, n.fontFamily) + 8 <= o && s - F.top >= 20
|
|
858
|
+
};
|
|
859
|
+
}), X = (e, t) => t.map((t) => `${L(t)},${R(e[t])}`), $ = [
|
|
860
|
+
re.map((e) => _`
|
|
861
|
+
${e.segments.map((e) => _`<polygon fill="url(#hatch-${c})"
|
|
862
|
+
points=${`${L(e.k)},${F.top} ${L(e.k + 1)},${F.top} ${L(e.k + 1)},${e.right} ${L(e.k)},${e.left}`} />`)}
|
|
863
|
+
${e.fits ? _`<text x=${e.from + e.width / 2} y=${(F.top + e.ceiling) / 2 + 4}
|
|
864
|
+
text-anchor="middle"
|
|
865
|
+
class="lintje-chart__as-of-note lintje-chart__data-label--halo">${be}</text>` : u}
|
|
866
|
+
`),
|
|
867
|
+
_`<g class="lintje-chart__reveal" ${m(x.attach)}>
|
|
868
|
+
${g.map((e, t) => {
|
|
869
|
+
let n = B((e) => S[t][e]);
|
|
870
|
+
return _`<g>
|
|
871
|
+
${n.map((n) => n.length === 1 ? _`<circle cx=${L(n[0])} cy=${R(w[t][n[0]])} r="2.5" fill=${e.color} />` : _`<polygon fill=${e.color}
|
|
872
|
+
points=${[...X(w[t], n), ...X(C[t], n).reverse()].join(" ")} />`)}
|
|
873
|
+
</g>`;
|
|
874
|
+
})}
|
|
875
|
+
<!-- Between two parts a 1 px line in the surface: along each part's lower edge, not the floor. -->
|
|
876
|
+
${g.map((e, t) => B((e) => S[t][e] && C[t][e] > 0).filter((e) => e.length > 1).map((e) => _`<polyline class="lintje-chart__segment" fill="none" points=${X(C[t], e).join(" ")} />`))}
|
|
877
|
+
</g>`,
|
|
878
|
+
n.hoverIndex != null && !b ? g.map((e, t) => S[t][n.hoverIndex] ? _`<circle class="lintje-chart__hover-point" r="4" fill=${e.color}
|
|
879
|
+
cx=${L(n.hoverIndex)} cy=${R(w[t][n.hoverIndex])} />` : u) : u,
|
|
880
|
+
i.map((e, t) => {
|
|
881
|
+
let r = D(F) / Math.max(1, d - 1);
|
|
882
|
+
return _`
|
|
883
|
+
<rect x=${L(t) - r / 2} y=${F.top} width=${r}
|
|
884
|
+
height=${I - F.top}
|
|
885
|
+
fill="transparent"
|
|
886
|
+
@mousemove=${(e) => n.hoverAt(t, e, K(t))}
|
|
887
|
+
@mouseleave=${() => n.hoverAt(null)} />
|
|
888
|
+
`;
|
|
889
|
+
})
|
|
890
|
+
];
|
|
891
|
+
return p`
|
|
892
|
+
<div class="lintje-chart-wrap ${s ? "lintje-chart--small" : ""}"
|
|
893
|
+
${m(n.attach)} ?data-in-view=${n.inView} data-tooltip-anchor
|
|
894
|
+
@keydown=${(e) => n.dismiss(e)}>
|
|
895
|
+
${z({
|
|
896
|
+
items: H,
|
|
897
|
+
onToggle: (e) => n.toggleSeries(e)
|
|
898
|
+
})}
|
|
899
|
+
${ee({
|
|
900
|
+
fontFamily: n.fontFamily,
|
|
901
|
+
id: c,
|
|
902
|
+
ticks: M,
|
|
903
|
+
max: j,
|
|
904
|
+
area: F,
|
|
905
|
+
formatTick: P.format,
|
|
906
|
+
axisTitle: a ?? o,
|
|
907
|
+
xLabels: W,
|
|
908
|
+
description: r,
|
|
909
|
+
keys: J
|
|
910
|
+
}, $)}
|
|
911
|
+
${U(n)}
|
|
912
|
+
${Q(n)}
|
|
684
913
|
</div>
|
|
685
914
|
`;
|
|
686
915
|
}
|
|
687
916
|
//#endregion
|
|
688
917
|
//#region src/components/shared/charts/pie-chart/pie-chart.ts
|
|
689
|
-
var
|
|
918
|
+
var Ee = 5, De = (e) => {
|
|
690
919
|
let t = e.label.toLowerCase();
|
|
691
920
|
return t.startsWith("overig") || t === "rest";
|
|
692
|
-
},
|
|
693
|
-
function
|
|
694
|
-
let t = e.filter(
|
|
695
|
-
if (t.length >
|
|
921
|
+
}, Oe = (e) => !e.remainder && !De(e);
|
|
922
|
+
function ke(e) {
|
|
923
|
+
let t = e.filter(Oe).sort((e, t) => t.value - e.value), n = e.filter((e) => !e.remainder && De(e)), r = e.filter((e) => e.remainder);
|
|
924
|
+
if (t.length > Ee) {
|
|
696
925
|
let e = t.splice(4).reduce((e, t) => e + t.value, 0);
|
|
697
926
|
if (n.length > 0) {
|
|
698
927
|
let [t] = n;
|
|
@@ -712,82 +941,82 @@ function be(e) {
|
|
|
712
941
|
...r
|
|
713
942
|
];
|
|
714
943
|
}
|
|
715
|
-
function
|
|
716
|
-
let { controller:
|
|
944
|
+
function Ae(e, t) {
|
|
945
|
+
let { controller: n, description: r } = t, { donut: i = !1, centerValue: a, centerLabel: o, legendTable: c = !0, labelHeader: f = "Categorie" } = e, h = n.id, g = ke(e.segments).map((e) => ({
|
|
717
946
|
...e,
|
|
718
|
-
color:
|
|
719
|
-
})), v =
|
|
947
|
+
color: F(e.color)
|
|
948
|
+
})), v = g.map((e) => e.href ? {
|
|
720
949
|
id: e.id ?? e.label,
|
|
721
950
|
href: e.href
|
|
722
|
-
} : null), y =
|
|
723
|
-
let t = y.of(v[e],
|
|
951
|
+
} : null), y = le(t, v), b = (e) => {
|
|
952
|
+
let t = y.of(v[e], g[e].label, g[e].label).state;
|
|
724
953
|
return t.includes("is-selected") ? "is-selected" : t.includes("is-muted") ? "is-muted" : "";
|
|
725
954
|
}, x = !!t.expanded;
|
|
726
|
-
|
|
955
|
+
n.measure(x ? {
|
|
727
956
|
width: !0,
|
|
728
957
|
height: "--chart-h-main"
|
|
729
958
|
} : {});
|
|
730
|
-
let S = x ? Math.max(240, Math.min(560,
|
|
731
|
-
let n = e.value / C, r = k,
|
|
732
|
-
k =
|
|
733
|
-
let
|
|
959
|
+
let S = x ? Math.max(240, Math.min(560, n.height - 24)) : e.size ?? 200, C = g.reduce((e, t) => e + t.value, 0), w = S / 2, T = i ? w * .62 : 0, E = _e(g.filter(Oe).length, e.color), D = -1, O = g.map((e) => (Oe(e) && (D += 1), e.color ?? (e.remainder ? "var(--color-chart-remainder)" : De(e) ? "var(--color-chart-other)" : E[Math.min(D, E.length - 1)]))), k = -90, A = g.map((e, t) => {
|
|
960
|
+
let n = e.value / C, r = k, a = k + n * 360;
|
|
961
|
+
k = a;
|
|
962
|
+
let o = +(n > .5), s = (e, t) => [w + t * Math.cos(e * Math.PI / 180), w + t * Math.sin(e * Math.PI / 180)], [c, l] = s(r, w), [u, d] = s(a, w);
|
|
734
963
|
return {
|
|
735
964
|
segment: e,
|
|
736
965
|
i: t,
|
|
737
|
-
d:
|
|
738
|
-
let [e, t] = s(
|
|
739
|
-
return `M ${c} ${l} A ${w} ${w} 0 ${
|
|
740
|
-
})() : `M ${w} ${w} L ${c} ${l} A ${w} ${w} 0 ${
|
|
966
|
+
d: i ? (() => {
|
|
967
|
+
let [e, t] = s(a, T), [n, i] = s(r, T);
|
|
968
|
+
return `M ${c} ${l} A ${w} ${w} 0 ${o} 1 ${u} ${d} L ${e} ${t} A ${T} ${T} 0 ${o} 0 ${n} ${i} Z`;
|
|
969
|
+
})() : `M ${w} ${w} L ${c} ${l} A ${w} ${w} 0 ${o} 1 ${u} ${d} Z`,
|
|
741
970
|
color: O[t]
|
|
742
971
|
};
|
|
743
|
-
}), j =
|
|
744
|
-
|
|
972
|
+
}), j = n.hoverSegment, N = j == null ? void 0 : A[j], I = (e) => {
|
|
973
|
+
n.hoverSegment = e, n.requestUpdate();
|
|
745
974
|
};
|
|
746
|
-
return
|
|
747
|
-
<div class="lintje-pie-chart ${x ? "lintje-pie-chart--expanded" : ""}" ${
|
|
748
|
-
?data-in-view=${
|
|
749
|
-
@keydown=${(e) =>
|
|
750
|
-
<svg viewBox="0 0 ${S} ${S}" width=${S} height=${S} role=${
|
|
751
|
-
class="lintje-pie-chart__svg" aria-labelledby="${
|
|
752
|
-
<desc id="${
|
|
753
|
-
<defs>${
|
|
754
|
-
${A.map(({ segment: e, i: t, d:
|
|
755
|
-
let
|
|
756
|
-
return
|
|
757
|
-
<path d=${
|
|
758
|
-
class="lintje-pie-chart__segment lintje-chart__mark lintje-chart__segment ${j === t ? "is-hovered" : ""} ${
|
|
759
|
-
${
|
|
760
|
-
data-mark-id=${
|
|
761
|
-
aria-pressed=${
|
|
762
|
-
@click=${
|
|
763
|
-
@mousemove=${(
|
|
764
|
-
|
|
975
|
+
return p`
|
|
976
|
+
<div class="lintje-pie-chart ${x ? "lintje-pie-chart--expanded" : ""}" ${m(n.attach)}
|
|
977
|
+
?data-in-view=${n.inView} data-tooltip-anchor
|
|
978
|
+
@keydown=${(e) => n.dismiss(e) || y.escape(e)}>
|
|
979
|
+
<svg viewBox="0 0 ${S} ${S}" width=${S} height=${S} role=${R(y.interactive)}
|
|
980
|
+
class="lintje-pie-chart__svg" aria-labelledby="${h}-desc" ${s(M(h))}>
|
|
981
|
+
<desc id="${h}-desc">${r}</desc>
|
|
982
|
+
<defs>${P(h)}</defs>
|
|
983
|
+
${A.map(({ segment: e, i: t, d: r, color: i }) => {
|
|
984
|
+
let a = y.of(v[t], e.label, `${e.label}: ${l(e.value)} · ${d(e.value / C * 100)}`);
|
|
985
|
+
return _`
|
|
986
|
+
<path d=${r} fill=${i}
|
|
987
|
+
class="lintje-pie-chart__segment lintje-chart__mark lintje-chart__segment ${j === t ? "is-hovered" : ""} ${a.state}"
|
|
988
|
+
${s({ "transform-origin": `${w}px ${w}px` })}
|
|
989
|
+
data-mark-id=${a.markId} role=${a.role} tabindex=${a.tabIndex}
|
|
990
|
+
aria-pressed=${a.pressed} aria-label=${a.label}
|
|
991
|
+
@click=${a.click} @keydown=${a.keydown}
|
|
992
|
+
@mousemove=${(r) => {
|
|
993
|
+
I(t), n.showTooltip(r, {
|
|
765
994
|
title: e.label,
|
|
766
995
|
rows: [{
|
|
767
996
|
label: "Aantal",
|
|
768
|
-
value: `${
|
|
769
|
-
color:
|
|
997
|
+
value: `${l(e.value)} · ${d(e.value / C * 100)}`,
|
|
998
|
+
color: i
|
|
770
999
|
}]
|
|
771
1000
|
});
|
|
772
1001
|
}}
|
|
773
1002
|
@mouseleave=${() => {
|
|
774
|
-
|
|
1003
|
+
n.hoverSegment = null, n.hideTooltip(), n.requestUpdate();
|
|
775
1004
|
}} />
|
|
776
1005
|
`;
|
|
777
1006
|
})}
|
|
778
1007
|
<!-- The hovered segment once more on top, lifted with a light shadow: in place, the
|
|
779
1008
|
next segment would cover that shadow on one side (user test 13 Sep). -->
|
|
780
|
-
${
|
|
781
|
-
${
|
|
782
|
-
${
|
|
783
|
-
<text x=${w} y=${w + 2} text-anchor="middle" class="lintje-pie-chart__center">${
|
|
784
|
-
${
|
|
785
|
-
` :
|
|
1009
|
+
${N ? _`<path d=${N.d} fill=${N.color} class="lintje-pie-chart__lift lintje-chart__segment"
|
|
1010
|
+
${s({ "transform-origin": `${w}px ${w}px` })} aria-hidden="true" />` : u}
|
|
1011
|
+
${i && a ? _`
|
|
1012
|
+
<text x=${w} y=${w + 2} text-anchor="middle" class="lintje-pie-chart__center">${a}</text>
|
|
1013
|
+
${o ? _`<text x=${w} y=${w + 20} text-anchor="middle" class="lintje-chart__axis-label">${o}</text>` : u}
|
|
1014
|
+
` : u}
|
|
786
1015
|
</svg>
|
|
787
1016
|
|
|
788
|
-
${
|
|
1017
|
+
${c ? p`
|
|
789
1018
|
<table class="lintje-pie-chart__table">
|
|
790
|
-
<caption class="visually-hidden">Legenda: ${
|
|
1019
|
+
<caption class="visually-hidden">Legenda: ${r}</caption>
|
|
791
1020
|
<thead>
|
|
792
1021
|
<tr>
|
|
793
1022
|
<th scope="col" class="lintje-pie-chart__column-label">${f}</th>
|
|
@@ -796,46 +1025,46 @@ function xe(e, t) {
|
|
|
796
1025
|
</tr>
|
|
797
1026
|
</thead>
|
|
798
1027
|
<tbody>
|
|
799
|
-
${
|
|
1028
|
+
${g.map((e, t) => p`
|
|
800
1029
|
<tr class="lintje-pie-chart__row ${j === t ? "is-hovered" : ""} ${b(t)}"
|
|
801
|
-
@mouseenter=${() =>
|
|
1030
|
+
@mouseenter=${() => I(t)} @mouseleave=${() => I(null)}>
|
|
802
1031
|
<th scope="row" class="lintje-pie-chart__label">
|
|
803
|
-
<span class="lintje-pie-chart__marker" ${
|
|
1032
|
+
<span class="lintje-pie-chart__marker" ${s({ background: O[t] })}></span>${e.label}
|
|
804
1033
|
</th>
|
|
805
|
-
<td class="lintje-pie-chart__value">${
|
|
806
|
-
<td class="lintje-pie-chart__value">${
|
|
1034
|
+
<td class="lintje-pie-chart__value">${l(e.value)}</td>
|
|
1035
|
+
<td class="lintje-pie-chart__value">${d(e.value / C * 100)}</td>
|
|
807
1036
|
</tr>
|
|
808
1037
|
`)}
|
|
809
1038
|
</tbody>
|
|
810
1039
|
<tfoot>
|
|
811
1040
|
<tr>
|
|
812
1041
|
<th scope="row" class="lintje-pie-chart__total-label">Totaal</th>
|
|
813
|
-
<td class="lintje-pie-chart__total">${
|
|
1042
|
+
<td class="lintje-pie-chart__total">${l(C)}</td>
|
|
814
1043
|
<td class="lintje-pie-chart__total"></td>
|
|
815
1044
|
</tr>
|
|
816
1045
|
</tfoot>
|
|
817
1046
|
</table>
|
|
818
|
-
` :
|
|
819
|
-
${
|
|
1047
|
+
` : u}
|
|
1048
|
+
${U(n)}
|
|
820
1049
|
</div>
|
|
821
1050
|
`;
|
|
822
1051
|
}
|
|
823
1052
|
//#endregion
|
|
824
1053
|
//#region src/components/shared/charts/dual-axis-chart/dual-axis-chart.ts
|
|
825
|
-
function
|
|
826
|
-
let { controller:
|
|
1054
|
+
function je(e, t) {
|
|
1055
|
+
let { controller: n, description: r } = t, { labels: i, threshold: a, thresholdLabel: o, small: c = !1, pendingHours: d = 0 } = e, f = {
|
|
827
1056
|
...e.left,
|
|
828
|
-
color:
|
|
829
|
-
},
|
|
1057
|
+
color: F(e.left.color)
|
|
1058
|
+
}, h = {
|
|
830
1059
|
...e.right,
|
|
831
|
-
color:
|
|
832
|
-
},
|
|
833
|
-
|
|
1060
|
+
color: F(e.right.color)
|
|
1061
|
+
}, g = n.id;
|
|
1062
|
+
n.measure({
|
|
834
1063
|
width: !0,
|
|
835
|
-
height: t.height ?? (
|
|
1064
|
+
height: t.height ?? (c ? "--chart-h-small" : "--chart-h-main"),
|
|
836
1065
|
fit: !!t.expanded && !t.mobile
|
|
837
1066
|
});
|
|
838
|
-
let v = f.color ?? "var(--color-chart-default)", y =
|
|
1067
|
+
let v = f.color ?? "var(--color-chart-default)", y = h.color ?? "var(--color-chart-dark-yellow)", b = q(Math.max(...f.values.filter((e) => e != null), 1)), x = q(Math.max(...h.values.filter((e) => e != null), a ?? 0, 1)), S = N(b.ticks, n.width, { fontFamily: n.fontFamily }), C = N(x.ticks, n.width, { fontFamily: n.fontFamily }), w = ne(t, {
|
|
839
1068
|
left: S.width,
|
|
840
1069
|
right: C.width
|
|
841
1070
|
}), T = w.height - w.bottom, E = [
|
|
@@ -845,61 +1074,61 @@ function Se(e, t) {
|
|
|
845
1074
|
shape: "square"
|
|
846
1075
|
},
|
|
847
1076
|
{
|
|
848
|
-
label: `${
|
|
1077
|
+
label: `${h.label} (rechteras)`,
|
|
849
1078
|
color: y,
|
|
850
1079
|
shape: "line"
|
|
851
1080
|
},
|
|
852
|
-
...
|
|
853
|
-
label:
|
|
1081
|
+
...a == null ? [] : [{
|
|
1082
|
+
label: o ?? `Norm ${a}`,
|
|
854
1083
|
color: "var(--color-chart-emphasis)",
|
|
855
1084
|
shape: "dashed"
|
|
856
1085
|
}]
|
|
857
|
-
], D = Math.max(1, Math.ceil(
|
|
858
|
-
|
|
859
|
-
e == null ? M[M.length - 1].length && M.push([]) : M[M.length - 1].push(`${
|
|
1086
|
+
], D = Math.max(1, Math.ceil(i.length / 8)), A = n.hoverIndex, j = H(y), M = [[]];
|
|
1087
|
+
h.values.forEach((e, t) => {
|
|
1088
|
+
e == null ? M[M.length - 1].length && M.push([]) : M[M.length - 1].push(`${k(t, i.length, w).center},${O(e, x.max, w)}`);
|
|
860
1089
|
});
|
|
861
|
-
let
|
|
862
|
-
title:
|
|
1090
|
+
let P = (e, t) => e == null ? "geen gegevens" : `${l(e)}${t ? ` ${t}` : ""}`, I = (e) => ({
|
|
1091
|
+
title: i[e],
|
|
863
1092
|
rows: [{
|
|
864
1093
|
label: f.label,
|
|
865
|
-
value:
|
|
1094
|
+
value: P(f.values[e], f.unit),
|
|
866
1095
|
color: v
|
|
867
1096
|
}, {
|
|
868
|
-
label:
|
|
869
|
-
value:
|
|
1097
|
+
label: h.label,
|
|
1098
|
+
value: P(h.values[e], h.unit),
|
|
870
1099
|
color: y
|
|
871
1100
|
}]
|
|
872
|
-
}), L =
|
|
873
|
-
x:
|
|
874
|
-
y: Math.min(f.values[e] == null ? T :
|
|
875
|
-
content:
|
|
1101
|
+
}), L = Z(n, i.length, (e) => ({
|
|
1102
|
+
x: k(e, i.length, w).center,
|
|
1103
|
+
y: Math.min(f.values[e] == null ? T : O(f.values[e], b.max, w), h.values[e] == null ? T : O(h.values[e], x.max, w)),
|
|
1104
|
+
content: I(e)
|
|
876
1105
|
}));
|
|
877
|
-
return
|
|
878
|
-
<div class="lintje-chart-wrap ${
|
|
879
|
-
${
|
|
880
|
-
@keydown=${(e) =>
|
|
881
|
-
${
|
|
1106
|
+
return p`
|
|
1107
|
+
<div class="lintje-chart-wrap ${c ? "lintje-chart--small" : ""}"
|
|
1108
|
+
${m(n.attach)} ?data-in-view=${n.inView} data-tooltip-anchor
|
|
1109
|
+
@keydown=${(e) => n.dismiss(e)}>
|
|
1110
|
+
${z({ items: E })}
|
|
882
1111
|
<figure class="lintje-chart">
|
|
883
|
-
<svg viewBox="0 0 ${w.width} ${w.height}" class="lintje-chart__svg" role=${
|
|
884
|
-
aria-labelledby="${
|
|
1112
|
+
<svg viewBox="0 0 ${w.width} ${w.height}" class="lintje-chart__svg" role=${R(!1)}
|
|
1113
|
+
aria-labelledby="${g}-desc" width=${w.width} height=${w.height}
|
|
885
1114
|
tabindex="0" @keydown=${L.keydown} @focus=${L.focus} @blur=${L.blur}>
|
|
886
|
-
<desc id="${
|
|
1115
|
+
<desc id="${g}-desc">${r}</desc>
|
|
887
1116
|
<defs>
|
|
888
|
-
<pattern id="hatch-${
|
|
1117
|
+
<pattern id="hatch-${g}" width="6" height="6" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
|
|
889
1118
|
<line x1="0" y1="0" x2="0" y2="6" stroke="var(--color-chart-hatch)" stroke-width="2" />
|
|
890
1119
|
</pattern>
|
|
891
1120
|
</defs>
|
|
892
1121
|
<!-- Incomplete hours at the end: hatched, never drawn as zero. -->
|
|
893
1122
|
${d > 0 ? (() => {
|
|
894
|
-
let e =
|
|
895
|
-
return
|
|
1123
|
+
let e = k(i.length - d, i.length, w);
|
|
1124
|
+
return _`<rect x=${e.x - (e.bandWidth - e.width) / 2} y=${w.top}
|
|
896
1125
|
width=${w.width - w.right - e.x + (e.bandWidth - e.width) / 2}
|
|
897
|
-
height=${T - w.top} fill="url(#hatch-${
|
|
898
|
-
})() :
|
|
1126
|
+
height=${T - w.top} fill="url(#hatch-${g})" />`;
|
|
1127
|
+
})() : u}
|
|
899
1128
|
|
|
900
1129
|
${b.ticks.map((e) => {
|
|
901
|
-
let t =
|
|
902
|
-
return
|
|
1130
|
+
let t = O(e, b.max, w), n = e === 0;
|
|
1131
|
+
return _`
|
|
903
1132
|
<g>
|
|
904
1133
|
<line x1=${w.left} x2=${w.width - w.right} y1=${t} y2=${t}
|
|
905
1134
|
stroke=${n ? "var(--color-chart-zero)" : "var(--color-chart-grid)"}
|
|
@@ -910,8 +1139,8 @@ function Se(e, t) {
|
|
|
910
1139
|
</g>
|
|
911
1140
|
`;
|
|
912
1141
|
})}
|
|
913
|
-
${x.ticks.map((e) =>
|
|
914
|
-
<text x=${w.width - w.right + 8} y=${
|
|
1142
|
+
${x.ticks.map((e) => _`
|
|
1143
|
+
<text x=${w.width - w.right + 8} y=${O(e, x.max, w) + 4}
|
|
915
1144
|
class="lintje-chart__axis-label" fill=${"var(--color-chart-dark-yellow-text)"}>${C.format(e)}</text>
|
|
916
1145
|
`)}
|
|
917
1146
|
|
|
@@ -923,88 +1152,88 @@ function Se(e, t) {
|
|
|
923
1152
|
<!-- Bars grow in one after another; the hit areas below sit on top, so hover comes
|
|
924
1153
|
from hoverIndex rather than :hover. -->
|
|
925
1154
|
${f.values.map((e, t) => {
|
|
926
|
-
let n =
|
|
927
|
-
if (e == null) return
|
|
928
|
-
height=${Math.max(0, T - w.top)} fill="url(#hatch-${
|
|
929
|
-
let r =
|
|
930
|
-
return
|
|
931
|
-
<g class="lintje-chart__bar-group ${
|
|
932
|
-
${
|
|
1155
|
+
let n = k(t, i.length, w);
|
|
1156
|
+
if (e == null) return _`<rect class="lintje-chart__missing" x=${n.x} y=${w.top} width=${n.width}
|
|
1157
|
+
height=${Math.max(0, T - w.top)} fill="url(#hatch-${g})" />`;
|
|
1158
|
+
let r = O(e, b.max, w);
|
|
1159
|
+
return _`
|
|
1160
|
+
<g class="lintje-chart__bar-group ${A === t ? "is-hovered" : ""}"
|
|
1161
|
+
${s(B(t, i.length))}>
|
|
933
1162
|
<rect class="lintje-chart__bar" x=${n.x} y=${r} width=${n.width}
|
|
934
1163
|
height=${Math.max(0, T - r)} fill=${v} />
|
|
935
1164
|
</g>
|
|
936
1165
|
`;
|
|
937
1166
|
})}
|
|
938
1167
|
|
|
939
|
-
${
|
|
940
|
-
y1=${
|
|
1168
|
+
${a == null ? u : _`<line x1=${w.left} x2=${w.width - w.right}
|
|
1169
|
+
y1=${O(a, x.max, w)} y2=${O(a, x.max, w)}
|
|
941
1170
|
stroke="var(--color-chart-emphasis)" stroke-width="1" stroke-dasharray="4 3" />`}
|
|
942
1171
|
|
|
943
1172
|
<g class="lintje-chart__reveal">
|
|
944
1173
|
${M.filter((e) => e.length > 0).map((e) => {
|
|
945
|
-
let t = e.join(" "), [
|
|
946
|
-
return
|
|
947
|
-
${j && e.length > 1 ?
|
|
948
|
-
stroke=${j} points=${t} />` :
|
|
949
|
-
${e.length === 1 ?
|
|
1174
|
+
let t = e.join(" "), [n, r] = e[0].split(",");
|
|
1175
|
+
return _`
|
|
1176
|
+
${j && e.length > 1 ? _`<polyline class="lintje-chart__line lintje-chart__line--casing"
|
|
1177
|
+
stroke=${j} points=${t} />` : u}
|
|
1178
|
+
${e.length === 1 ? _`<circle cx=${n} cy=${r} r="2.5" fill=${y} />` : _`<polyline class="lintje-chart__line" stroke=${y} points=${t} />`}
|
|
950
1179
|
`;
|
|
951
1180
|
})}
|
|
952
1181
|
</g>
|
|
953
1182
|
|
|
954
|
-
${
|
|
955
|
-
<text x=${
|
|
1183
|
+
${i.filter((e, t) => t % D === 0).map((e, t) => _`
|
|
1184
|
+
<text x=${k(t * D, i.length, w).center} y=${w.height - 8}
|
|
956
1185
|
text-anchor="middle" class="lintje-chart__axis-label">${e}</text>
|
|
957
1186
|
`)}
|
|
958
1187
|
|
|
959
1188
|
<!-- Hover point on the right-axis line; no point for a missing value. -->
|
|
960
|
-
${
|
|
961
|
-
cx=${A
|
|
962
|
-
cy=${
|
|
963
|
-
${
|
|
964
|
-
let
|
|
965
|
-
return
|
|
966
|
-
<rect x=${
|
|
1189
|
+
${A != null && h.values[A] != null ? _`<circle class="lintje-chart__hover-point" r="4" fill=${y}
|
|
1190
|
+
cx=${k(A, i.length, w).center}
|
|
1191
|
+
cy=${O(h.values[A], x.max, w)} />` : u}
|
|
1192
|
+
${i.map((e, t) => {
|
|
1193
|
+
let r = k(t, i.length, w);
|
|
1194
|
+
return _`
|
|
1195
|
+
<rect x=${r.x} y=${w.top} width=${r.bandWidth} height=${T - w.top}
|
|
967
1196
|
fill="transparent"
|
|
968
|
-
@mousemove=${(e) =>
|
|
969
|
-
@mouseleave=${() =>
|
|
1197
|
+
@mousemove=${(e) => n.hoverAt(t, e, I(t))}
|
|
1198
|
+
@mouseleave=${() => n.hoverAt(null)} />
|
|
970
1199
|
`;
|
|
971
1200
|
})}
|
|
972
1201
|
</svg>
|
|
973
1202
|
</figure>
|
|
974
|
-
${
|
|
975
|
-
${
|
|
1203
|
+
${U(n)}
|
|
1204
|
+
${Q(n)}
|
|
976
1205
|
</div>
|
|
977
1206
|
`;
|
|
978
1207
|
}
|
|
979
1208
|
//#endregion
|
|
980
1209
|
//#region src/components/shared/charts/scatter-chart/scatter-chart.ts
|
|
981
|
-
var
|
|
982
|
-
function
|
|
1210
|
+
var Me = 4.5, Ne = 5.5, Pe = 44, Fe = 8, Ie = (e, t) => e.left < t.right && t.left < e.right && e.top < t.bottom && t.top < e.bottom;
|
|
1211
|
+
function Le(e, t, n, r) {
|
|
983
1212
|
let i = 5.5, a = [];
|
|
984
1213
|
for (let [o, s] of e.entries()) {
|
|
985
1214
|
if (!t.includes(s.label)) continue;
|
|
986
|
-
let c =
|
|
1215
|
+
let c = h(s.label, r, 700), l = s.y - 9, u = l - 12, d = l + 3, f = [{
|
|
987
1216
|
anchor: "end",
|
|
988
|
-
x: s.x -
|
|
989
|
-
left: s.x -
|
|
1217
|
+
x: s.x - Fe,
|
|
1218
|
+
left: s.x - Fe - c
|
|
990
1219
|
}, {
|
|
991
1220
|
anchor: "start",
|
|
992
|
-
x: s.x +
|
|
993
|
-
left: s.x +
|
|
1221
|
+
x: s.x + Fe,
|
|
1222
|
+
left: s.x + Fe
|
|
994
1223
|
}].map((e) => ({
|
|
995
1224
|
...e,
|
|
996
1225
|
right: e.left + c,
|
|
997
1226
|
top: u,
|
|
998
|
-
bottom:
|
|
999
|
-
})).find((t) => t.left >= n.left && t.right <= n.width - n.right && t.top >= 0 && a.every((e) => !
|
|
1227
|
+
bottom: d
|
|
1228
|
+
})).find((t) => t.left >= n.left && t.right <= n.width - n.right && t.top >= 0 && a.every((e) => !Ie(t, e)) && e.every((e, n) => n === o || !Ie(t, {
|
|
1000
1229
|
left: e.x - i,
|
|
1001
1230
|
right: e.x + i,
|
|
1002
1231
|
top: e.y - i,
|
|
1003
1232
|
bottom: e.y + i
|
|
1004
1233
|
})));
|
|
1005
|
-
if (!
|
|
1234
|
+
if (!f) return [];
|
|
1006
1235
|
a.push({
|
|
1007
|
-
...
|
|
1236
|
+
...f,
|
|
1008
1237
|
label: s.label,
|
|
1009
1238
|
y: l
|
|
1010
1239
|
});
|
|
@@ -1016,37 +1245,37 @@ function Oe(e, t, n, r) {
|
|
|
1016
1245
|
anchor: r
|
|
1017
1246
|
}));
|
|
1018
1247
|
}
|
|
1019
|
-
var
|
|
1020
|
-
function
|
|
1021
|
-
let t = new Set(e.series.map((e) => e.color).filter(
|
|
1248
|
+
var Re = (e) => e.charAt(0).toUpperCase() + e.slice(1), ze = (e, t) => `${l(e)}${t ? ` ${t}` : ""}`;
|
|
1249
|
+
function Be(e) {
|
|
1250
|
+
let t = new Set(e.series.map((e) => e.color).filter(I)), n = L.filter((e) => !t.has(e)), r = 0;
|
|
1022
1251
|
return e.series.map((e) => {
|
|
1023
|
-
let t =
|
|
1252
|
+
let t = I(e.color) ? e.color : n[r++ % n.length];
|
|
1024
1253
|
return {
|
|
1025
|
-
color:
|
|
1254
|
+
color: F(e.color ?? t),
|
|
1026
1255
|
symbol: t
|
|
1027
1256
|
};
|
|
1028
1257
|
});
|
|
1029
1258
|
}
|
|
1030
|
-
function
|
|
1031
|
-
let { controller:
|
|
1032
|
-
|
|
1259
|
+
function Ve(e, n) {
|
|
1260
|
+
let { controller: r, description: i } = n, { axisTitle: a, unit: o, xTitle: c, xUnit: d, threshold: h, thresholdLabel: g, small: v = !1 } = e, y = r.id;
|
|
1261
|
+
r.measure({
|
|
1033
1262
|
width: !0,
|
|
1034
|
-
height:
|
|
1035
|
-
fit: !!
|
|
1263
|
+
height: n.height ?? (v ? "--chart-h-small" : "--chart-h-main"),
|
|
1264
|
+
fit: !!n.expanded && !n.mobile
|
|
1036
1265
|
});
|
|
1037
|
-
let b =
|
|
1266
|
+
let b = Be(e), x = e.series.map((e, t) => ({
|
|
1038
1267
|
...e,
|
|
1039
1268
|
...b[t]
|
|
1040
|
-
})), S = (e) =>
|
|
1269
|
+
})), S = (e) => r.hiddenSeries.includes(e.label), C = x.flatMap((e, t) => e.points.map((n, r) => ({
|
|
1041
1270
|
point: n,
|
|
1042
1271
|
row: e,
|
|
1043
1272
|
key: `${t}:${r}`
|
|
1044
|
-
})).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), w = C.filter(({ row: e }) => !S(e)), T = new Map(w.map((e, t) => [e.key, t])), E =
|
|
1273
|
+
})).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), w = C.filter(({ row: e }) => !S(e)), T = new Map(w.map((e, t) => [e.key, t])), E = q(Math.max(...w.map(({ point: e }) => e.x), 1), n.mobile ? 3 : 6), k = q(Math.max(...w.map(({ point: e }) => e.y), h ?? 0, 1)), A = N(k.ticks, r.width, { fontFamily: r.fontFamily }), M = ne(n, {
|
|
1045
1274
|
left: A.width,
|
|
1046
|
-
bottom:
|
|
1047
|
-
}),
|
|
1048
|
-
label:
|
|
1049
|
-
x:
|
|
1275
|
+
bottom: Pe
|
|
1276
|
+
}), P = (e) => M.left + D(M) * e / E.max, F = E.ticks.map((e, t) => ({
|
|
1277
|
+
label: l(e),
|
|
1278
|
+
x: P(e),
|
|
1050
1279
|
anchor: t === E.ticks.length - 1 ? "end" : "middle"
|
|
1051
1280
|
})), I = [...x.map((e) => ({
|
|
1052
1281
|
label: e.label,
|
|
@@ -1054,8 +1283,8 @@ function Me(t, r) {
|
|
|
1054
1283
|
shape: "point",
|
|
1055
1284
|
symbol: e.symbol,
|
|
1056
1285
|
hidden: S(e)
|
|
1057
|
-
})), ...
|
|
1058
|
-
label:
|
|
1286
|
+
})), ...h == null ? [] : [{
|
|
1287
|
+
label: g ?? "Norm",
|
|
1059
1288
|
color: "var(--color-chart-emphasis)",
|
|
1060
1289
|
shape: "dashed",
|
|
1061
1290
|
fixed: !0
|
|
@@ -1072,131 +1301,131 @@ function Me(t, r) {
|
|
|
1072
1301
|
symbol: n.symbol
|
|
1073
1302
|
},
|
|
1074
1303
|
{
|
|
1075
|
-
label:
|
|
1076
|
-
value:
|
|
1304
|
+
label: Re(c),
|
|
1305
|
+
value: ze(t.x, d)
|
|
1077
1306
|
},
|
|
1078
1307
|
{
|
|
1079
|
-
label:
|
|
1080
|
-
value:
|
|
1308
|
+
label: Re(a),
|
|
1309
|
+
value: ze(t.y, o)
|
|
1081
1310
|
}
|
|
1082
1311
|
]
|
|
1083
1312
|
};
|
|
1084
1313
|
}
|
|
1085
1314
|
let R = (e) => ({
|
|
1086
|
-
x:
|
|
1087
|
-
y:
|
|
1088
|
-
}),
|
|
1089
|
-
...
|
|
1315
|
+
x: P(e.x),
|
|
1316
|
+
y: O(e.y, k.max, M)
|
|
1317
|
+
}), V = (e) => R(w[e].point), te = Z(r, w.length, (e) => ({
|
|
1318
|
+
...V(e),
|
|
1090
1319
|
content: L(e)
|
|
1091
|
-
})),
|
|
1320
|
+
})), W = w.map(({ point: e, row: t }) => e.href ? {
|
|
1092
1321
|
id: e.id ?? `${t.label} · ${e.label}`,
|
|
1093
1322
|
href: e.href
|
|
1094
|
-
} : null),
|
|
1323
|
+
} : null), G = le(n, W), K = w.map(({ point: e }, t) => G.of(W[t], e.label, re(L(t)))), J = Le(w.map((e, t) => ({
|
|
1095
1324
|
label: e.point.label,
|
|
1096
|
-
...
|
|
1097
|
-
})),
|
|
1098
|
-
let n =
|
|
1325
|
+
...V(t)
|
|
1326
|
+
})), e.dataLabels ?? [], M, r.fontFamily), Y = h == null ? 0 : O(h, k.max, M), X = r.hoverIndex == null ? void 0 : w[r.hoverIndex], $ = (e) => {
|
|
1327
|
+
let n = e.target.closest?.("[data-point]");
|
|
1099
1328
|
if (n) return Number(n.getAttribute("data-point"));
|
|
1100
|
-
let r =
|
|
1329
|
+
let r = e.currentTarget, i = r.ownerSVGElement?.getBoundingClientRect(), a = i && i.width > 0 ? M.width / i.width : 1, o = (e.clientX - (i?.left ?? 0)) * a, s = (e.clientY - (i?.top ?? 0)) * a, c = t(r, "--h-target", 48) / 2, l = null, u = c;
|
|
1101
1330
|
return w.forEach((e, t) => {
|
|
1102
|
-
let { x: n, y: r } =
|
|
1331
|
+
let { x: n, y: r } = V(t), i = Math.hypot(n - o, r - s);
|
|
1103
1332
|
i <= u && (l = t, u = i);
|
|
1104
1333
|
}), l;
|
|
1105
|
-
},
|
|
1106
|
-
let t =
|
|
1107
|
-
t == null ? (
|
|
1108
|
-
},
|
|
1109
|
-
let t =
|
|
1110
|
-
|
|
1111
|
-
},
|
|
1334
|
+
}, ie = (e) => {
|
|
1335
|
+
let t = $(e);
|
|
1336
|
+
t == null ? (r.hoverIndex != null || r.tooltip) && r.hoverAt(null) : r.hoverAt(t, e, L(t));
|
|
1337
|
+
}, ae = (e) => {
|
|
1338
|
+
let t = $(e), n = t == null ? null : K[t];
|
|
1339
|
+
n?.clickable && n.click !== u && n.click();
|
|
1340
|
+
}, oe = X != null && K[r.hoverIndex]?.clickable, se = [h == null ? u : _`
|
|
1112
1341
|
<g class="lintje-chart__reference">
|
|
1113
|
-
<line x1=${
|
|
1342
|
+
<line x1=${M.left} x2=${M.width - M.right} y1=${Y} y2=${Y}
|
|
1114
1343
|
stroke="var(--color-chart-emphasis)" stroke-width="1" stroke-dasharray="3 3" />
|
|
1115
|
-
<text x=${
|
|
1344
|
+
<text x=${M.left + 6} y=${Y - 6}
|
|
1116
1345
|
class="lintje-chart__axis-label lintje-chart__axis-label--halo">
|
|
1117
|
-
${
|
|
1346
|
+
${g ?? `norm ${ze(h, o)}`}
|
|
1118
1347
|
</text>
|
|
1119
1348
|
</g>
|
|
1120
|
-
`,
|
|
1121
|
-
<rect class="lintje-chart__hit ${
|
|
1122
|
-
x="0" y="0" width=${
|
|
1349
|
+
`, _`<g @mousemove=${ie} @mouseleave=${() => r.hoverAt(null)} @click=${ae}>
|
|
1350
|
+
<rect class="lintje-chart__hit ${oe ? "is-clickable" : ""}"
|
|
1351
|
+
x="0" y="0" width=${M.width} height=${M.height} />
|
|
1123
1352
|
<g>
|
|
1124
|
-
${
|
|
1125
|
-
let { x:
|
|
1126
|
-
return
|
|
1127
|
-
<path class="lintje-chart__point lintje-chart__mark ${
|
|
1128
|
-
${
|
|
1129
|
-
d=${
|
|
1130
|
-
stroke=${
|
|
1131
|
-
data-point=${
|
|
1132
|
-
data-mark-id=${
|
|
1133
|
-
tabindex=${
|
|
1134
|
-
aria-pressed=${
|
|
1135
|
-
@keydown=${
|
|
1353
|
+
${f(C, (e) => e.key, ({ point: e, row: t, key: n }, r) => {
|
|
1354
|
+
let { x: i, y: a } = R(e), o = H(t.color), c = T.get(n), l = c == null ? void 0 : K[c];
|
|
1355
|
+
return _`
|
|
1356
|
+
<path class="lintje-chart__point lintje-chart__mark ${o ? "" : "lintje-chart__segment"} ${l?.state ?? "is-hidden"}"
|
|
1357
|
+
${s(B(r, C.length))}
|
|
1358
|
+
d=${j(t.symbol, Me, i, a)} fill=${t.color}
|
|
1359
|
+
stroke=${o ?? u} stroke-width=${o ? 1 : u}
|
|
1360
|
+
data-point=${c ?? u}
|
|
1361
|
+
data-mark-id=${l?.markId ?? u} role=${l?.role ?? u}
|
|
1362
|
+
tabindex=${l?.tabIndex ?? u}
|
|
1363
|
+
aria-pressed=${l?.pressed ?? u} aria-label=${l?.label ?? u}
|
|
1364
|
+
@keydown=${l?.keydown ?? u} />
|
|
1136
1365
|
`;
|
|
1137
1366
|
})}
|
|
1138
1367
|
</g>
|
|
1139
1368
|
|
|
1140
|
-
${
|
|
1369
|
+
${J.map((e) => _`
|
|
1141
1370
|
<text x=${e.x} y=${e.y} text-anchor=${e.anchor}
|
|
1142
1371
|
class="lintje-chart__data-label lintje-chart__data-label--halo">${e.label}</text>
|
|
1143
1372
|
`)}
|
|
1144
1373
|
|
|
1145
1374
|
<!-- The point under the pointer or the keyboard, raised with a ring in the surface. -->
|
|
1146
|
-
${
|
|
1147
|
-
let { x: e, y: t } =
|
|
1148
|
-
return
|
|
1149
|
-
<path class="lintje-chart__hover-point" d=${
|
|
1150
|
-
${
|
|
1375
|
+
${X ? (() => {
|
|
1376
|
+
let { x: e, y: t } = V(r.hoverIndex), n = H(X.row.color), i = j(X.row.symbol, Ne, e, t);
|
|
1377
|
+
return _`
|
|
1378
|
+
<path class="lintje-chart__hover-point" d=${i} fill=${X.row.color} />
|
|
1379
|
+
${n ? _`<path class="lintje-chart__hover-casing" d=${i} stroke=${n} />` : u}
|
|
1151
1380
|
`;
|
|
1152
|
-
})() :
|
|
1381
|
+
})() : u}
|
|
1153
1382
|
</g>`];
|
|
1154
|
-
return
|
|
1383
|
+
return p`
|
|
1155
1384
|
<div class="lintje-chart-wrap ${v ? "lintje-chart--small" : ""}"
|
|
1156
|
-
${
|
|
1157
|
-
@keydown=${(e) =>
|
|
1158
|
-
${
|
|
1385
|
+
${m(r.attach)} ?data-in-view=${r.inView} data-tooltip-anchor
|
|
1386
|
+
@keydown=${(e) => r.dismiss(e) || G.escape(e)}>
|
|
1387
|
+
${z({
|
|
1159
1388
|
items: I,
|
|
1160
|
-
onToggle: (e) =>
|
|
1389
|
+
onToggle: (e) => r.toggleSeries(e)
|
|
1161
1390
|
})}
|
|
1162
|
-
${
|
|
1163
|
-
fontFamily:
|
|
1391
|
+
${ee({
|
|
1392
|
+
fontFamily: r.fontFamily,
|
|
1164
1393
|
id: y,
|
|
1165
|
-
ticks:
|
|
1166
|
-
max:
|
|
1167
|
-
area:
|
|
1394
|
+
ticks: k.ticks,
|
|
1395
|
+
max: k.max,
|
|
1396
|
+
area: M,
|
|
1168
1397
|
formatTick: A.format,
|
|
1169
|
-
axisTitle:
|
|
1398
|
+
axisTitle: a,
|
|
1170
1399
|
xLabels: F,
|
|
1171
|
-
xTitle:
|
|
1172
|
-
description:
|
|
1173
|
-
interactive:
|
|
1174
|
-
keys:
|
|
1175
|
-
},
|
|
1176
|
-
${
|
|
1177
|
-
${
|
|
1400
|
+
xTitle: c,
|
|
1401
|
+
description: i,
|
|
1402
|
+
interactive: G.interactive,
|
|
1403
|
+
keys: te
|
|
1404
|
+
}, se)}
|
|
1405
|
+
${U(r)}
|
|
1406
|
+
${Q(r)}
|
|
1178
1407
|
</div>
|
|
1179
1408
|
`;
|
|
1180
1409
|
}
|
|
1181
1410
|
//#endregion
|
|
1182
1411
|
//#region src/components/shared/charts/heatmap-chart/heatmap-classes.ts
|
|
1183
|
-
var
|
|
1412
|
+
var He = [
|
|
1184
1413
|
"var(--color-chart-seq-1)",
|
|
1185
1414
|
"var(--color-chart-seq-2)",
|
|
1186
1415
|
"var(--color-chart-seq-3)",
|
|
1187
1416
|
"var(--color-chart-seq-4)",
|
|
1188
1417
|
"var(--color-chart-seq-5)"
|
|
1189
|
-
],
|
|
1418
|
+
], Ue = He.length, We = [
|
|
1190
1419
|
1,
|
|
1191
1420
|
2,
|
|
1192
1421
|
2.5,
|
|
1193
1422
|
5,
|
|
1194
1423
|
10
|
|
1195
1424
|
];
|
|
1196
|
-
function
|
|
1425
|
+
function Ge(e, t) {
|
|
1197
1426
|
if (!(e > 0) || !Number.isFinite(e)) return 1;
|
|
1198
1427
|
let n = 10 ** Math.floor(Math.log10(e)), r = 0, i = Infinity;
|
|
1199
|
-
for (let a of
|
|
1428
|
+
for (let a of We) {
|
|
1200
1429
|
let o = a * n;
|
|
1201
1430
|
if (t && !Number.isInteger(o)) continue;
|
|
1202
1431
|
let s = Math.abs(Math.log(o / e));
|
|
@@ -1204,29 +1433,29 @@ function Ie(e, t) {
|
|
|
1204
1433
|
}
|
|
1205
1434
|
return r || (t ? 1 : n);
|
|
1206
1435
|
}
|
|
1207
|
-
function
|
|
1436
|
+
function Ke(e, t) {
|
|
1208
1437
|
let n = Math.max(0, Math.min(10, -Math.floor(Math.log10(t)) + 1));
|
|
1209
1438
|
return Number(e.toFixed(n));
|
|
1210
1439
|
}
|
|
1211
|
-
function
|
|
1440
|
+
function qe(e) {
|
|
1212
1441
|
let t = [];
|
|
1213
1442
|
for (let n of e) for (let e of n ?? []) e != null && Number.isFinite(e) && t.push(e);
|
|
1214
1443
|
if (t.length === 0) return [];
|
|
1215
1444
|
let n = Math.min(...t), r = Math.max(...t);
|
|
1216
1445
|
if (n === r) return [];
|
|
1217
|
-
let i = t.every(Number.isInteger), a =
|
|
1218
|
-
for (let e = 1; e <
|
|
1219
|
-
let t =
|
|
1446
|
+
let i = t.every(Number.isInteger), a = Ge((r - n) / Ue, i), o = Math.floor(n / a) * a, s = [];
|
|
1447
|
+
for (let e = 1; e < Ue; e += 1) {
|
|
1448
|
+
let t = Ke(o + e * a, a);
|
|
1220
1449
|
if (t > r) break;
|
|
1221
1450
|
s.push(t);
|
|
1222
1451
|
}
|
|
1223
1452
|
return s;
|
|
1224
1453
|
}
|
|
1225
|
-
function
|
|
1226
|
-
let r =
|
|
1454
|
+
function Je(e, t, n = 0) {
|
|
1455
|
+
let r = l(e, n), i = t?.trim() ?? "";
|
|
1227
1456
|
return i ? i === "%" ? `${r}%` : `${r} ${i}` : r;
|
|
1228
1457
|
}
|
|
1229
|
-
function
|
|
1458
|
+
function Ye(e) {
|
|
1230
1459
|
let t = 0;
|
|
1231
1460
|
for (let n of e) {
|
|
1232
1461
|
let e = String(n), r = e.indexOf(".");
|
|
@@ -1234,13 +1463,13 @@ function Be(e) {
|
|
|
1234
1463
|
}
|
|
1235
1464
|
return Math.min(t, 4);
|
|
1236
1465
|
}
|
|
1237
|
-
function
|
|
1238
|
-
let n = (t.bounds?.length ? t.bounds.slice(0,
|
|
1466
|
+
function Xe(e, t = {}) {
|
|
1467
|
+
let n = (t.bounds?.length ? t.bounds.slice(0, Ue - 1) : null) ?? qe(e), r = Ye(n), i = (e) => Je(e, t.unit, r), a = (e) => l(e, r);
|
|
1239
1468
|
if (n.length === 0) {
|
|
1240
|
-
let e =
|
|
1469
|
+
let e = He.length - 1;
|
|
1241
1470
|
return [{
|
|
1242
1471
|
limit: Infinity,
|
|
1243
|
-
color:
|
|
1472
|
+
color: He[e],
|
|
1244
1473
|
label: "alle waarden",
|
|
1245
1474
|
ramp: e
|
|
1246
1475
|
}];
|
|
@@ -1248,106 +1477,106 @@ function Ve(e, t = {}) {
|
|
|
1248
1477
|
return [
|
|
1249
1478
|
{
|
|
1250
1479
|
limit: n[0],
|
|
1251
|
-
color:
|
|
1480
|
+
color: He[0],
|
|
1252
1481
|
label: `< ${i(n[0])}`,
|
|
1253
1482
|
ramp: 0
|
|
1254
1483
|
},
|
|
1255
1484
|
...n.slice(1).map((e, t) => ({
|
|
1256
1485
|
limit: e,
|
|
1257
|
-
color:
|
|
1486
|
+
color: He[t + 1],
|
|
1258
1487
|
label: `${a(n[t])}–${i(e)}`,
|
|
1259
1488
|
ramp: t + 1
|
|
1260
1489
|
})),
|
|
1261
1490
|
{
|
|
1262
1491
|
limit: Infinity,
|
|
1263
|
-
color:
|
|
1492
|
+
color: He[n.length],
|
|
1264
1493
|
label: `≥ ${i(n[n.length - 1])}`,
|
|
1265
1494
|
ramp: n.length
|
|
1266
1495
|
}
|
|
1267
1496
|
];
|
|
1268
1497
|
}
|
|
1269
|
-
function
|
|
1498
|
+
function Ze(e, t) {
|
|
1270
1499
|
let n = e.findIndex((e) => t < e.limit);
|
|
1271
1500
|
return n === -1 ? e.length - 1 : n;
|
|
1272
1501
|
}
|
|
1273
1502
|
//#endregion
|
|
1274
1503
|
//#region src/components/shared/charts/heatmap-chart/heatmap-chart.ts
|
|
1275
|
-
function
|
|
1504
|
+
function Qe(e, t, n) {
|
|
1276
1505
|
return Array.from({ length: n }, (n, r) => Array.from({ length: t }, (t, n) => e?.[n]?.[r]));
|
|
1277
1506
|
}
|
|
1278
|
-
function
|
|
1507
|
+
function $e(e) {
|
|
1279
1508
|
if (e.mobile) return e.mobile;
|
|
1280
1509
|
let t = e.rowLabels.length, n = e.columnLabels.length;
|
|
1281
1510
|
if (!(n <= t)) return {
|
|
1282
1511
|
columnLabels: e.rowLabels,
|
|
1283
1512
|
rowLabels: e.columnLabels,
|
|
1284
|
-
values:
|
|
1285
|
-
links: e.links ?
|
|
1513
|
+
values: Qe(e.values, t, n),
|
|
1514
|
+
links: e.links ? Qe(e.links, t, n) : void 0
|
|
1286
1515
|
};
|
|
1287
1516
|
}
|
|
1288
|
-
function
|
|
1289
|
-
let { controller:
|
|
1517
|
+
function et(e, t) {
|
|
1518
|
+
let { controller: n, description: r, mobile: i = !1 } = t, a = i ? $e(e) : void 0, o = a?.columnLabels ?? e.columnLabels, c = a?.rowLabels ?? e.rowLabels, d = a?.values ?? e.values, f = a ? a.links : e.links, h = a ? !0 : e.compact ?? !1, { unit: g } = e, _ = le(t, (f ?? []).flat()), v = Xe(d, {
|
|
1290
1519
|
bounds: e.bounds,
|
|
1291
|
-
unit:
|
|
1292
|
-
}), y = (e) =>
|
|
1293
|
-
|
|
1294
|
-
let b =
|
|
1295
|
-
return
|
|
1296
|
-
<div class="lintje-heatmap" ${
|
|
1297
|
-
data-tooltip-anchor @keydown=${
|
|
1298
|
-
<table class="lintje-heatmap__grid ${
|
|
1299
|
-
<caption class="visually-hidden">${
|
|
1520
|
+
unit: g
|
|
1521
|
+
}), y = (e) => Ze(v, e);
|
|
1522
|
+
n.measure({});
|
|
1523
|
+
let b = n.selectedCell, x = n.dimmedClass;
|
|
1524
|
+
return p`
|
|
1525
|
+
<div class="lintje-heatmap" ${m(n.attach)} ?data-in-view=${n.inView}
|
|
1526
|
+
data-tooltip-anchor @keydown=${_.escape}>
|
|
1527
|
+
<table class="lintje-heatmap__grid ${h ? "is-compact" : ""}">
|
|
1528
|
+
<caption class="visually-hidden">${r}</caption>
|
|
1300
1529
|
<thead>
|
|
1301
1530
|
<tr>
|
|
1302
1531
|
<td></td>
|
|
1303
|
-
${
|
|
1532
|
+
${o.map((e) => p`<th scope="col" class="lintje-heatmap__column-label">${e}</th>`)}
|
|
1304
1533
|
</tr>
|
|
1305
1534
|
</thead>
|
|
1306
1535
|
<tbody>
|
|
1307
|
-
${
|
|
1536
|
+
${c.map((e, t) => p`
|
|
1308
1537
|
<tr>
|
|
1309
1538
|
<th scope="row" class="lintje-heatmap__row-label" title=${e}>
|
|
1310
1539
|
<span class="lintje-heatmap__row-label-text">${e}</span>
|
|
1311
1540
|
</th>
|
|
1312
|
-
${
|
|
1313
|
-
let a =
|
|
1314
|
-
if (a == null) return
|
|
1541
|
+
${o.map((r, i) => {
|
|
1542
|
+
let a = d[t]?.[i];
|
|
1543
|
+
if (a == null) return p`
|
|
1315
1544
|
<td class="lintje-heatmap__slot">
|
|
1316
1545
|
<div class="lintje-heatmap__cell is-empty"
|
|
1317
|
-
title="${e} · ${
|
|
1546
|
+
title="${e} · ${o[i]}: geen meting">
|
|
1318
1547
|
<span class="visually-hidden">geen meting</span>
|
|
1319
1548
|
</div>
|
|
1320
1549
|
</td>
|
|
1321
1550
|
`;
|
|
1322
|
-
let
|
|
1323
|
-
return
|
|
1551
|
+
let u = y(a), m = _.of(f?.[t]?.[i], `${e} · ${o[i]}`), S = !m.clickable && b?.row === t && b?.column === i;
|
|
1552
|
+
return p`
|
|
1324
1553
|
<td class="lintje-heatmap__slot">
|
|
1325
1554
|
<button
|
|
1326
1555
|
type="button"
|
|
1327
|
-
class="lintje-heatmap__cell lintje-heatmap__cell--class-${v[
|
|
1328
|
-
data-mark-id=${
|
|
1329
|
-
${
|
|
1330
|
-
"--lintje-cell": v[
|
|
1331
|
-
...
|
|
1556
|
+
class="lintje-heatmap__cell lintje-heatmap__cell--class-${v[u].ramp} ${S ? "is-selected" : ""} ${x != null && x !== u ? "is-dimmed" : ""} ${m.state}"
|
|
1557
|
+
data-mark-id=${m.markId}
|
|
1558
|
+
${s({
|
|
1559
|
+
"--lintje-cell": v[u].color,
|
|
1560
|
+
...te(i, t, o.length, c.length)
|
|
1332
1561
|
})}
|
|
1333
|
-
@click=${
|
|
1334
|
-
|
|
1562
|
+
@click=${m.clickable ? m.click : () => {
|
|
1563
|
+
n.selectedCell = S ? null : {
|
|
1335
1564
|
row: t,
|
|
1336
1565
|
column: i
|
|
1337
|
-
},
|
|
1566
|
+
}, n.requestUpdate();
|
|
1338
1567
|
}}
|
|
1339
|
-
@mousemove=${
|
|
1340
|
-
title: `${e} · ${
|
|
1568
|
+
@mousemove=${h ? void 0 : (t) => n.showTooltip(t, {
|
|
1569
|
+
title: `${e} · ${o[i]}`,
|
|
1341
1570
|
rows: [{
|
|
1342
|
-
label: `klasse ${v[
|
|
1343
|
-
value:
|
|
1344
|
-
color: v[
|
|
1571
|
+
label: `klasse ${v[u].label}`,
|
|
1572
|
+
value: Je(a, g),
|
|
1573
|
+
color: v[u].color
|
|
1345
1574
|
}]
|
|
1346
1575
|
})}
|
|
1347
|
-
@mouseleave=${
|
|
1348
|
-
aria-pressed=${
|
|
1349
|
-
aria-label="${e} ${
|
|
1350
|
-
>${
|
|
1576
|
+
@mouseleave=${h ? void 0 : () => n.hideTooltip()}
|
|
1577
|
+
aria-pressed=${m.clickable ? m.pressed : S}
|
|
1578
|
+
aria-label="${e} ${o[i]}: ${Je(a, g)}, klasse ${v[u].label}"
|
|
1579
|
+
>${l(a)}</button>
|
|
1351
1580
|
</td>
|
|
1352
1581
|
`;
|
|
1353
1582
|
})}
|
|
@@ -1357,242 +1586,558 @@ function Ge(e, t) {
|
|
|
1357
1586
|
</table>
|
|
1358
1587
|
|
|
1359
1588
|
<!-- Selected cell: a 48 px line with day, block, value, class. -->
|
|
1360
|
-
${b &&
|
|
1589
|
+
${b && d[b.row]?.[b.column] != null ? p`
|
|
1361
1590
|
<p class="lintje-heatmap__selection">
|
|
1362
|
-
<b>${
|
|
1363
|
-
${
|
|
1364
|
-
${v[y(
|
|
1591
|
+
<b>${c[b.row]} ${o[b.column]}</b> ·
|
|
1592
|
+
${Je(d[b.row][b.column], g)} · klasse
|
|
1593
|
+
${v[y(d[b.row][b.column])].label}
|
|
1365
1594
|
</p>
|
|
1366
|
-
` :
|
|
1595
|
+
` : u}
|
|
1367
1596
|
|
|
1368
1597
|
<!-- Class legend: clickable, dims the other classes to .25. -->
|
|
1369
1598
|
<ul class="lintje-heatmap__legend">
|
|
1370
|
-
${v.map((e, t) =>
|
|
1599
|
+
${v.map((e, t) => p`
|
|
1371
1600
|
<li>
|
|
1372
1601
|
<button type="button" class="lintje-heatmap__legend-item ${x != null && x !== t ? "is-dimmed" : ""}"
|
|
1373
1602
|
@click=${() => {
|
|
1374
|
-
|
|
1603
|
+
n.dimmedClass = x === t ? null : t, n.requestUpdate();
|
|
1375
1604
|
}}
|
|
1376
1605
|
aria-pressed=${x === t}>
|
|
1377
|
-
<span class="lintje-heatmap__swatch lintje-heatmap__swatch--class-${e.ramp}" ${
|
|
1606
|
+
<span class="lintje-heatmap__swatch lintje-heatmap__swatch--class-${e.ramp}" ${s({ background: e.color })}></span>
|
|
1378
1607
|
<span>${e.label}</span>
|
|
1379
1608
|
</button>
|
|
1380
1609
|
</li>
|
|
1381
1610
|
`)}
|
|
1382
1611
|
</ul>
|
|
1383
|
-
${
|
|
1612
|
+
${U(n)}
|
|
1384
1613
|
</div>
|
|
1385
1614
|
`;
|
|
1386
1615
|
}
|
|
1387
1616
|
//#endregion
|
|
1388
1617
|
//#region src/components/shared/charts/histogram-chart/histogram-chart.ts
|
|
1389
|
-
var
|
|
1390
|
-
function
|
|
1391
|
-
return
|
|
1618
|
+
var tt = 16, nt = 56, rt = 8, it = 18;
|
|
1619
|
+
function at(e) {
|
|
1620
|
+
return l(e, +!Number.isInteger(e));
|
|
1392
1621
|
}
|
|
1393
|
-
function
|
|
1622
|
+
function ot(e, t) {
|
|
1394
1623
|
let n = t ? ` ${t}` : "";
|
|
1395
|
-
return e.to == null ? `${
|
|
1624
|
+
return e.to == null ? `${at(e.from)}${n} of meer` : `${at(e.from)} tot ${at(e.to)}${n}`;
|
|
1396
1625
|
}
|
|
1397
|
-
function
|
|
1626
|
+
function st(e, t, n = "") {
|
|
1398
1627
|
let r = t.width, i = e.map((e) => {
|
|
1399
|
-
let t =
|
|
1628
|
+
let t = h(e.text, n, e.bold ? 700 : 400), i = e.x + 6 + t <= r;
|
|
1400
1629
|
return {
|
|
1401
1630
|
x: i ? e.x + 6 : e.x - 6,
|
|
1402
1631
|
anchor: i ? "start" : "end",
|
|
1403
1632
|
left: i ? e.x + 6 : e.x - 6 - t,
|
|
1404
1633
|
right: i ? e.x + 6 + t : e.x - 6
|
|
1405
1634
|
};
|
|
1406
|
-
}), a = i.length === 2 ? +(e[1].x >= e[0].x) : -1, o = i.length === 2 && i[0].left < i[1].right +
|
|
1635
|
+
}), a = i.length === 2 ? +(e[1].x >= e[0].x) : -1, o = i.length === 2 && i[0].left < i[1].right + rt && i[1].left < i[0].right + rt;
|
|
1407
1636
|
return i.map((e, n) => ({
|
|
1408
1637
|
x: e.x,
|
|
1409
|
-
y: t.top + 12 + (o && n === a ?
|
|
1638
|
+
y: t.top + 12 + (o && n === a ? it : 0),
|
|
1410
1639
|
anchor: e.anchor
|
|
1411
1640
|
}));
|
|
1412
1641
|
}
|
|
1413
|
-
function
|
|
1414
|
-
let { controller:
|
|
1415
|
-
|
|
1642
|
+
function ct(e, t) {
|
|
1643
|
+
let { controller: n, description: r } = t, { bins: i, axisTitle: a, xTitle: o, unit: c, median: f, threshold: g, small: v = !1 } = e, y = e.label ?? "Aantal", b = F(e.color) ?? "var(--color-chart-default)", x = n.id, S = (e) => c ? `${e} ${c}` : e;
|
|
1644
|
+
n.measure({
|
|
1416
1645
|
width: !0,
|
|
1417
1646
|
height: t.height ?? (v ? "--chart-h-small" : "--chart-h-main"),
|
|
1418
1647
|
fit: !!t.expanded && !t.mobile
|
|
1419
1648
|
});
|
|
1420
|
-
let C =
|
|
1649
|
+
let C = i.map((e) => e.count).filter((e) => e != null), w = C.length === i.length ? C.reduce((e, t) => e + t, 0) : null, { max: T, ticks: E } = q(Math.max(...C, 1)), D = N(E, n.width, { fontFamily: n.fontFamily }), k = ne(t), A = ne(t, {
|
|
1421
1650
|
left: D.width,
|
|
1422
|
-
bottom:
|
|
1423
|
-
}), j = A.height - A.bottom, M = A.width - A.right,
|
|
1424
|
-
let t =
|
|
1651
|
+
bottom: k.bottom + (o ? tt : 0)
|
|
1652
|
+
}), j = A.height - A.bottom, M = A.width - A.right, P = i[0]?.from ?? 0, I = i[i.length - 1], L = i.length > 1 ? i[i.length - 1].from - i[i.length - 2].from : 1, R = I ? I.to ?? I.from + L : 1, V = (e) => A.left + (e - P) / Math.max(R - P, 2 ** -52) * (M - A.left), H = i.map((e) => {
|
|
1653
|
+
let t = V(e.from), n = V(e.to ?? R) - t;
|
|
1425
1654
|
return {
|
|
1426
1655
|
x: t,
|
|
1427
1656
|
width: n,
|
|
1428
1657
|
center: t + n / 2
|
|
1429
1658
|
};
|
|
1430
1659
|
}), te = (e) => {
|
|
1431
|
-
let t =
|
|
1660
|
+
let t = i[e].count;
|
|
1432
1661
|
return {
|
|
1433
|
-
title:
|
|
1662
|
+
title: ot(i[e], c),
|
|
1434
1663
|
rows: [{
|
|
1435
1664
|
label: y,
|
|
1436
|
-
value: t == null ? "geen gegevens" :
|
|
1665
|
+
value: t == null ? "geen gegevens" : l(t),
|
|
1437
1666
|
color: b
|
|
1438
1667
|
}, ...t != null && w != null && w > 0 ? [{
|
|
1439
1668
|
label: "Aandeel",
|
|
1440
|
-
value:
|
|
1669
|
+
value: d(t / w * 100, 1),
|
|
1441
1670
|
color: b
|
|
1442
1671
|
}] : []]
|
|
1443
1672
|
};
|
|
1444
|
-
},
|
|
1445
|
-
x:
|
|
1446
|
-
y:
|
|
1673
|
+
}, G = Z(n, i.length, (e) => ({
|
|
1674
|
+
x: H[e].center,
|
|
1675
|
+
y: i[e].count == null ? A.top : O(i[e].count, T, A),
|
|
1447
1676
|
content: te(e)
|
|
1448
|
-
})),
|
|
1449
|
-
label:
|
|
1450
|
-
x:
|
|
1451
|
-
})),
|
|
1452
|
-
label: `${
|
|
1453
|
-
x:
|
|
1454
|
-
} : null,
|
|
1455
|
-
|
|
1456
|
-
let
|
|
1457
|
-
x:
|
|
1458
|
-
text: e.medianLabel ?? S(`mediaan ${
|
|
1677
|
+
})), K = I?.to == null && i.length > 0, J = [...i.slice(0, K ? -1 : void 0).map((e) => e.from), ...K ? [] : I ? [I.to] : []].map((e) => ({
|
|
1678
|
+
label: at(e),
|
|
1679
|
+
x: V(e)
|
|
1680
|
+
})), Y = K ? {
|
|
1681
|
+
label: `${at(I.from)}+`,
|
|
1682
|
+
x: H[H.length - 1].center
|
|
1683
|
+
} : null, re = J.length > 1 ? (J[J.length - 1].x - J[0].x) / (J.length - 1) : 1, X = Math.max(1, Math.ceil(nt / re)), $ = W(J.filter((e, t) => t % X === 0), n.fontFamily), ie = (e, t) => Math.abs(t.x - e.x) < (h(e.label, n.fontFamily) + h(t.label, n.fontFamily)) / 2 + rt, ae = K ? Y : J[J.length - 1];
|
|
1684
|
+
ae && !$.includes(ae) && ($.length && ie($[$.length - 1], ae) && ($ = $.slice(0, -1)), K || ($ = [...$, ae]));
|
|
1685
|
+
let oe = K ? I.from : R, se = (e) => e != null && e >= P && e <= oe, ce = [...se(f) ? [{
|
|
1686
|
+
x: V(f),
|
|
1687
|
+
text: e.medianLabel ?? S(`mediaan ${at(f)}`),
|
|
1459
1688
|
bold: !0,
|
|
1460
1689
|
dashed: !1
|
|
1461
|
-
}] : [], ...
|
|
1462
|
-
x:
|
|
1463
|
-
text: e.thresholdLabel ?? S(`norm ${
|
|
1690
|
+
}] : [], ...se(g) ? [{
|
|
1691
|
+
x: V(g),
|
|
1692
|
+
text: e.thresholdLabel ?? S(`norm ${at(g)}`),
|
|
1464
1693
|
bold: !1,
|
|
1465
1694
|
dashed: !0
|
|
1466
|
-
}] : []],
|
|
1695
|
+
}] : []], le = st(ce, A, n.fontFamily), ue = (e) => e.charAt(0).toUpperCase() + e.slice(1), de = [
|
|
1467
1696
|
{
|
|
1468
1697
|
label: y,
|
|
1469
1698
|
color: b,
|
|
1470
1699
|
shape: "square"
|
|
1471
1700
|
},
|
|
1472
|
-
...
|
|
1473
|
-
label:
|
|
1701
|
+
...se(f) ? [{
|
|
1702
|
+
label: ue(e.medianLabel ?? "Mediaan"),
|
|
1474
1703
|
color: "var(--color-chart-emphasis)",
|
|
1475
1704
|
shape: "line"
|
|
1476
1705
|
}] : [],
|
|
1477
|
-
...
|
|
1478
|
-
label:
|
|
1706
|
+
...se(g) ? [{
|
|
1707
|
+
label: ue(e.thresholdLabel ?? "Norm"),
|
|
1479
1708
|
color: "var(--color-chart-emphasis)",
|
|
1480
1709
|
shape: "dashed"
|
|
1481
1710
|
}] : []
|
|
1482
|
-
],
|
|
1483
|
-
let t =
|
|
1484
|
-
if (n == null) return
|
|
1711
|
+
], fe = (e) => {
|
|
1712
|
+
let t = H[e], n = i[e].count;
|
|
1713
|
+
if (n == null) return _`<rect class="lintje-chart__missing" x=${t.x} y=${A.top} width=${t.width}
|
|
1485
1714
|
height=${Math.max(0, j - A.top)} fill="url(#hatch-${x})" />`;
|
|
1486
|
-
let r =
|
|
1487
|
-
return
|
|
1488
|
-
<g class="lintje-chart__bar-group" ${
|
|
1715
|
+
let r = O(n, T, A);
|
|
1716
|
+
return _`
|
|
1717
|
+
<g class="lintje-chart__bar-group" ${s(B(e, i.length))}>
|
|
1489
1718
|
<rect class="lintje-chart__bar lintje-chart__segment" x=${t.x} y=${r} width=${t.width}
|
|
1490
1719
|
height=${Math.max(0, j - r)} fill=${b} />
|
|
1491
1720
|
</g>
|
|
1492
1721
|
`;
|
|
1493
|
-
},
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
x=${
|
|
1497
|
-
height=${Math.max(0, j -
|
|
1498
|
-
|
|
1722
|
+
}, pe = n.hoverIndex, me = pe == null ? null : i[pe]?.count, he = [
|
|
1723
|
+
i.map((e, t) => fe(t)),
|
|
1724
|
+
pe != null && me != null ? _`<rect class="lintje-chart__bar lintje-chart__bar--lifted lintje-chart__segment"
|
|
1725
|
+
x=${H[pe].x} y=${O(me, T, A)} width=${H[pe].width}
|
|
1726
|
+
height=${Math.max(0, j - O(me, T, A))} fill=${b} />` : u,
|
|
1727
|
+
$.map((e) => _`
|
|
1499
1728
|
<line x1=${e.x} x2=${e.x} y1=${j} y2=${j + 4}
|
|
1500
1729
|
stroke="var(--color-chart-zero)" stroke-width="1" />
|
|
1501
1730
|
<text x=${e.x} y=${j + 20} text-anchor="middle" class="lintje-chart__axis-label">${e.label}</text>
|
|
1502
1731
|
`),
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
let
|
|
1506
|
-
return
|
|
1732
|
+
Y ? _`<text x=${Y.x} y=${j + 20} text-anchor="middle" class="lintje-chart__axis-label">${Y.label}</text>` : u,
|
|
1733
|
+
ce.map((e, t) => {
|
|
1734
|
+
let n = le[t];
|
|
1735
|
+
return _`
|
|
1507
1736
|
<g class="lintje-chart__reference">
|
|
1508
1737
|
<line x1=${e.x} x2=${e.x} y1=${A.top} y2=${j}
|
|
1509
1738
|
stroke="var(--color-chart-emphasis)" stroke-width=${e.dashed ? 1 : 1.5}
|
|
1510
|
-
stroke-dasharray=${e.dashed ? "3 3" :
|
|
1511
|
-
<text x=${
|
|
1739
|
+
stroke-dasharray=${e.dashed ? "3 3" : u} />
|
|
1740
|
+
<text x=${n.x} y=${n.y} text-anchor=${n.anchor}
|
|
1512
1741
|
class=${e.bold ? "lintje-chart__data-label lintje-chart__data-label--halo" : "lintje-chart__axis-label lintje-chart__axis-label--halo"}>${e.text}</text>
|
|
1513
1742
|
</g>
|
|
1514
1743
|
`;
|
|
1515
1744
|
}),
|
|
1516
|
-
|
|
1745
|
+
H.map((e, t) => _`
|
|
1517
1746
|
<rect x=${e.x} y=${A.top} width=${e.width} height=${Math.max(0, j - A.top)}
|
|
1518
1747
|
fill="transparent"
|
|
1519
|
-
@mousemove=${(e) =>
|
|
1520
|
-
@mouseleave=${() =>
|
|
1748
|
+
@mousemove=${(e) => n.hoverAt(t, e, te(t))}
|
|
1749
|
+
@mouseleave=${() => n.hoverAt(null)} />
|
|
1521
1750
|
`)
|
|
1522
1751
|
];
|
|
1523
|
-
return
|
|
1752
|
+
return p`
|
|
1524
1753
|
<div class="lintje-chart-wrap ${v ? "lintje-chart--small" : ""}"
|
|
1525
|
-
${
|
|
1526
|
-
@keydown=${(e) =>
|
|
1527
|
-
${
|
|
1528
|
-
${
|
|
1529
|
-
fontFamily:
|
|
1754
|
+
${m(n.attach)} ?data-in-view=${n.inView} data-tooltip-anchor
|
|
1755
|
+
@keydown=${(e) => n.dismiss(e)}>
|
|
1756
|
+
${z({ items: de })}
|
|
1757
|
+
${ee({
|
|
1758
|
+
fontFamily: n.fontFamily,
|
|
1530
1759
|
id: x,
|
|
1531
1760
|
ticks: E,
|
|
1532
1761
|
max: T,
|
|
1533
1762
|
area: A,
|
|
1534
|
-
axisTitle:
|
|
1535
|
-
xTitle:
|
|
1536
|
-
description:
|
|
1763
|
+
axisTitle: a,
|
|
1764
|
+
xTitle: o,
|
|
1765
|
+
description: r,
|
|
1537
1766
|
formatTick: D.format,
|
|
1538
|
-
keys:
|
|
1767
|
+
keys: G
|
|
1539
1768
|
}, he)}
|
|
1540
|
-
${
|
|
1541
|
-
${
|
|
1769
|
+
${U(n)}
|
|
1770
|
+
${Q(n)}
|
|
1542
1771
|
</div>
|
|
1543
1772
|
`;
|
|
1544
1773
|
}
|
|
1545
1774
|
//#endregion
|
|
1775
|
+
//#region src/components/shared/charts/radar-chart/radar-chart.ts
|
|
1776
|
+
var lt = 16, ut = 6, dt = 18, ft = 16, pt = 3, mt = 4, ht = 8, gt = 40, _t = .7, vt = 420, yt = 12, bt = 2;
|
|
1777
|
+
function xt(e) {
|
|
1778
|
+
let t = new Set(e.series.map((e) => e.color).filter(I)), n = L.filter((e) => !t.has(e)), r = 0;
|
|
1779
|
+
return e.series.map((t) => {
|
|
1780
|
+
let i = e.axes.map((e, n) => t.values[n] ?? null);
|
|
1781
|
+
if (t.comparison) return {
|
|
1782
|
+
label: t.label,
|
|
1783
|
+
values: i,
|
|
1784
|
+
comparison: !0,
|
|
1785
|
+
color: "var(--color-chart-secondary)"
|
|
1786
|
+
};
|
|
1787
|
+
let a = I(t.color) ? t.color : n[r++ % n.length];
|
|
1788
|
+
return {
|
|
1789
|
+
label: t.label,
|
|
1790
|
+
values: i,
|
|
1791
|
+
comparison: !1,
|
|
1792
|
+
color: F(t.color ?? a),
|
|
1793
|
+
symbol: a
|
|
1794
|
+
};
|
|
1795
|
+
});
|
|
1796
|
+
}
|
|
1797
|
+
function St(e) {
|
|
1798
|
+
let t = e.length, n = e.findIndex((e) => e == null);
|
|
1799
|
+
if (n === -1) return {
|
|
1800
|
+
closed: !0,
|
|
1801
|
+
runs: [e.map((e, t) => t)]
|
|
1802
|
+
};
|
|
1803
|
+
let r = [], i = [];
|
|
1804
|
+
for (let a = 1; a <= t; a++) {
|
|
1805
|
+
let o = (n + a) % t;
|
|
1806
|
+
e[o] == null ? (i.length && r.push(i), i = []) : i.push(o);
|
|
1807
|
+
}
|
|
1808
|
+
return i.length && r.push(i), {
|
|
1809
|
+
closed: !1,
|
|
1810
|
+
runs: r
|
|
1811
|
+
};
|
|
1812
|
+
}
|
|
1813
|
+
function Ct(e, t = e / 5) {
|
|
1814
|
+
let n = [];
|
|
1815
|
+
for (let r = 1; r * t < e - t * 1e-6; r++) n.push(Math.round(r * t * 1e6) / 1e6);
|
|
1816
|
+
return [...n, e];
|
|
1817
|
+
}
|
|
1818
|
+
var wt = (e) => Number.isInteger(e) ? 0 : String(e).split(".")[1]?.length ?? 0;
|
|
1819
|
+
function Tt(e, t, n) {
|
|
1820
|
+
let r = e.area ?? "emphasis", i = t.filter((e) => !e.comparison);
|
|
1821
|
+
return new Set(i.filter((e) => e.complete && r !== "never" && (r === "always" || i.length === 1 || e.label === n)).map((e) => e.label));
|
|
1822
|
+
}
|
|
1823
|
+
function Et(e, t) {
|
|
1824
|
+
let { controller: n, description: r, mobile: i = !1 } = t, { axes: a, unit: o, threshold: c, small: u = !1 } = e, d = a.length, f = xt(e), h = (e) => n.hiddenSeries.includes(e.label), g = f.filter((e) => !h(e)), _ = f.filter((e) => !e.comparison), v = g.filter((e) => !e.comparison), y = Math.min(2, Math.max(0, ...f.flatMap((e) => e.values.filter((e) => e != null)).map(wt), ...c == null ? [] : [wt(c)])), b = (e) => l(e, y), x = (e) => `${b(e)}${o ? ` ${o}` : ""}`, S = (e) => {
|
|
1825
|
+
let t = Math.round(e * 10 ** y) / 10 ** y;
|
|
1826
|
+
return t === 0 ? b(0) : `${t > 0 ? "+" : "−"}${b(Math.abs(t))}`;
|
|
1827
|
+
}, C = v.length > 1 && v.some((e) => e.label === n.emphasis) ? n.emphasis : null, w = Tt(e, g.map((e) => ({
|
|
1828
|
+
...e,
|
|
1829
|
+
complete: e.values.every((e) => e != null)
|
|
1830
|
+
})), C), T = a.map((e, t) => f.some((e) => e.values[t] == null)), E = e.dataLabels !== !1 && _.length === 1, D = E && !h(_[0]), O = [
|
|
1831
|
+
...f.map((e) => e.comparison ? {
|
|
1832
|
+
label: e.label,
|
|
1833
|
+
color: e.color,
|
|
1834
|
+
shape: "line",
|
|
1835
|
+
hidden: h(e)
|
|
1836
|
+
} : {
|
|
1837
|
+
label: e.label,
|
|
1838
|
+
color: e.color,
|
|
1839
|
+
shape: "line",
|
|
1840
|
+
symbol: e.symbol,
|
|
1841
|
+
hidden: h(e)
|
|
1842
|
+
}),
|
|
1843
|
+
...c == null ? [] : [{
|
|
1844
|
+
label: e.thresholdLabel ?? `Norm ${x(c)}`,
|
|
1845
|
+
color: "var(--color-chart-emphasis)",
|
|
1846
|
+
shape: "dashed",
|
|
1847
|
+
fixed: !0
|
|
1848
|
+
}],
|
|
1849
|
+
...T.some(Boolean) ? [{
|
|
1850
|
+
label: "Geen gegevens",
|
|
1851
|
+
shape: "hatch",
|
|
1852
|
+
fixed: !0
|
|
1853
|
+
}] : []
|
|
1854
|
+
];
|
|
1855
|
+
function k(t) {
|
|
1856
|
+
let n = g.map((e) => {
|
|
1857
|
+
let n = e.values[t];
|
|
1858
|
+
return {
|
|
1859
|
+
label: e.label,
|
|
1860
|
+
value: n == null ? "geen gegevens" : x(n),
|
|
1861
|
+
color: e.color,
|
|
1862
|
+
symbol: e.symbol,
|
|
1863
|
+
marker: e.comparison ? "line" : void 0
|
|
1864
|
+
};
|
|
1865
|
+
});
|
|
1866
|
+
c != null && n.push({
|
|
1867
|
+
label: e.thresholdLabel ?? "Norm",
|
|
1868
|
+
value: x(c),
|
|
1869
|
+
color: "var(--color-chart-emphasis)",
|
|
1870
|
+
marker: "dashed"
|
|
1871
|
+
});
|
|
1872
|
+
let [r] = v, i = v.length === 1 ? r.values[t] : null;
|
|
1873
|
+
if (i != null) {
|
|
1874
|
+
let e = g.find((e) => e.comparison), r = e?.values[t];
|
|
1875
|
+
e && r != null && n.push({
|
|
1876
|
+
label: `t.o.v. ${e.label}`,
|
|
1877
|
+
value: S(i - r),
|
|
1878
|
+
divider: !0
|
|
1879
|
+
}), c != null && n.push({
|
|
1880
|
+
label: "t.o.v. norm",
|
|
1881
|
+
value: S(i - c),
|
|
1882
|
+
divider: !(e && r != null)
|
|
1883
|
+
});
|
|
1884
|
+
}
|
|
1885
|
+
return {
|
|
1886
|
+
title: a[t],
|
|
1887
|
+
rows: n
|
|
1888
|
+
};
|
|
1889
|
+
}
|
|
1890
|
+
let { width: A, height: j, body: M, at: N } = (i ? Ot : Dt)({
|
|
1891
|
+
spec: e,
|
|
1892
|
+
controller: n,
|
|
1893
|
+
options: t,
|
|
1894
|
+
layers: f,
|
|
1895
|
+
shown: g,
|
|
1896
|
+
fills: w,
|
|
1897
|
+
emphasis: C,
|
|
1898
|
+
missing: T,
|
|
1899
|
+
reserve: E,
|
|
1900
|
+
labelled: D,
|
|
1901
|
+
hidden: h,
|
|
1902
|
+
format: b,
|
|
1903
|
+
contentAt: k
|
|
1904
|
+
}), P = Z(n, d, (e) => ({
|
|
1905
|
+
...N(e),
|
|
1906
|
+
content: k(e)
|
|
1907
|
+
}));
|
|
1908
|
+
return p`
|
|
1909
|
+
<div class="lintje-chart-wrap ${u ? "lintje-chart--small" : ""}"
|
|
1910
|
+
${m(n.attach)} ?data-in-view=${n.inView} data-tooltip-anchor
|
|
1911
|
+
@keydown=${(e) => n.dismiss(e)}>
|
|
1912
|
+
${z({
|
|
1913
|
+
items: O,
|
|
1914
|
+
onToggle: (e) => n.toggleSeries(e),
|
|
1915
|
+
onEmphasis: _.length > 1 ? (e) => n.emphasise(e) : void 0
|
|
1916
|
+
})}
|
|
1917
|
+
<figure class="lintje-chart">
|
|
1918
|
+
<svg viewBox="0 0 ${A} ${j}" width=${A} height=${j}
|
|
1919
|
+
class="lintje-chart__svg lintje-radar ${i ? "lintje-radar--rows" : ""}"
|
|
1920
|
+
${s({ height: `${j}px` })}
|
|
1921
|
+
role=${R(!1)} aria-labelledby="${n.id}-desc" tabindex="0"
|
|
1922
|
+
@keydown=${P.keydown} @focus=${P.focus} @blur=${P.blur}>
|
|
1923
|
+
<desc id="${n.id}-desc">${r}</desc>
|
|
1924
|
+
<defs>
|
|
1925
|
+
<pattern id="hatch-${n.id}" width="6" height="6" patternUnits="userSpaceOnUse"
|
|
1926
|
+
patternTransform="rotate(45)">
|
|
1927
|
+
<line x1="0" y1="0" x2="0" y2="6" stroke="var(--color-chart-hatch)" stroke-width="2" />
|
|
1928
|
+
</pattern>
|
|
1929
|
+
</defs>
|
|
1930
|
+
${M}
|
|
1931
|
+
</svg>
|
|
1932
|
+
</figure>
|
|
1933
|
+
${U(n)}
|
|
1934
|
+
${Q(n)}
|
|
1935
|
+
</div>
|
|
1936
|
+
`;
|
|
1937
|
+
}
|
|
1938
|
+
function Dt({ spec: e, controller: t, options: n, layers: r, shown: i, fills: a, emphasis: o, missing: c, reserve: d, labelled: f, hidden: p, format: m, contentAt: g }) {
|
|
1939
|
+
let { axes: v, max: y, threshold: b, small: x = !1 } = e, S = v.length, C = x ? "--chart-h-small" : "--chart-h-main";
|
|
1940
|
+
t.measure({
|
|
1941
|
+
width: !0,
|
|
1942
|
+
height: n.height ?? C,
|
|
1943
|
+
fit: !!n.expanded
|
|
1944
|
+
});
|
|
1945
|
+
let w = t.width, T = n.height ?? (n.expanded || x ? t.height : Math.max(t.height, Math.min(vt, Math.round(w * _t)))), E = (e) => -Math.PI / 2 + 2 * Math.PI * e / S, D = t.fontFamily, O = (e) => h(e, D) * 14 / 12, k = Math.max(0, ...v.map((e, t) => Math.abs(Math.cos(E(t))) < .1 ? 0 : O(e) + ut + 2)), A = 24 + (d ? ft : 0), M = Math.max(gt, Math.min(w / 2 - k - lt, T / 2 - A - lt)), N = w / 2, P = T / 2, F = (e, t) => ({
|
|
1946
|
+
x: N + t * Math.cos(E(e)),
|
|
1947
|
+
y: P + t * Math.sin(E(e))
|
|
1948
|
+
}), 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 = Ct(y, e.step), B = Math.max(0, ...z.map(wt)), V = t.hoverIndex, U = (e) => {
|
|
1949
|
+
let t = i.map((t) => t.values[e]).filter((e) => e != null);
|
|
1950
|
+
return F(e, t.length ? I(Math.max(...t)) : M / 2);
|
|
1951
|
+
}, ee = [...r.filter((e) => e.comparison), ...r.filter((e) => !e.comparison)], te = (e) => o != null && e.label !== o, W = s({ "transform-origin": `${N}px ${P}px` }), G = v.map((e, t) => {
|
|
1952
|
+
let n = Math.cos(E(t)), i = Math.sin(E(t)), a = F(t, M + lt + ut), o = Math.abs(n) < .1, s = o ? "middle" : n > 0 ? "start" : "end", c;
|
|
1953
|
+
c = o && i < 0 ? a.y - 4 - (d ? ft : 0) : o ? a.y + 12 : d ? a.y - 2 : a.y + 5;
|
|
1954
|
+
let l = d ? r.find((e) => !e.comparison)?.values[t] : void 0;
|
|
1955
|
+
return _`
|
|
1956
|
+
<text x=${a.x} y=${c} text-anchor=${s} class="lintje-radar__name">${e}</text>
|
|
1957
|
+
${d ? _`<text x=${a.x} y=${c + ft} text-anchor=${s}
|
|
1958
|
+
class="lintje-chart__data-label lintje-radar__value ${l == null ? "lintje-radar__no-value" : ""} ${f ? "" : "is-hidden"}">
|
|
1959
|
+
${l == null ? "geen gegevens" : m(l)}</text>` : u}
|
|
1960
|
+
`;
|
|
1961
|
+
}), K = (e, t) => {
|
|
1962
|
+
let n = p(e) ? "is-hidden" : "", r = e.values.map((e, t) => e == null ? null : F(t, I(e)));
|
|
1963
|
+
if (t === "area") return e.comparison || r.some((e) => e == null) ? u : _`<g class="lintje-radar__layer ${n}" ${W}>
|
|
1964
|
+
<polygon class="lintje-radar__area ${a.has(e.label) ? "is-filled" : ""}"
|
|
1965
|
+
points=${L(r)} fill=${e.color} />
|
|
1966
|
+
</g>`;
|
|
1967
|
+
let { closed: i, runs: o } = St(e.values), s = e.comparison ? void 0 : H(e.color), c = o.map((t) => {
|
|
1968
|
+
let n = t.map((e) => r[e]), a = L(i ? [...n, n[0]] : n);
|
|
1969
|
+
return n.length === 1 ? e.comparison ? _`<circle cx=${n[0].x} cy=${n[0].y} r="2.5" fill=${e.color} />` : u : _`
|
|
1970
|
+
${s ? _`<polyline class="lintje-chart__line lintje-chart__line--casing" points=${a} stroke=${s} />` : u}
|
|
1971
|
+
<polyline class="lintje-chart__line" points=${a} stroke=${e.color} />
|
|
1972
|
+
`;
|
|
1973
|
+
}), l = e.symbol ? r.map((t) => t ? _`<path d=${j(e.symbol, pt, t.x, t.y)} fill=${e.color}
|
|
1974
|
+
stroke=${s ?? u} stroke-width=${s ? 1 : u} />` : u) : u;
|
|
1975
|
+
return t === "lift" ? _`<g class="lintje-radar__lift" aria-hidden="true">${c}${l}</g>` : _`<g class="lintje-radar__layer ${n} ${te(e) ? "is-muted" : ""}" ${W}>
|
|
1976
|
+
${c}${l}
|
|
1977
|
+
</g>`;
|
|
1978
|
+
}, q = (e) => {
|
|
1979
|
+
let t = M + lt, n = Math.PI / S, r = (e) => `${N + t * Math.cos(e)},${P + t * Math.sin(e)}`;
|
|
1980
|
+
return `${N},${P} ${r(E(e) - n)} ${r(E(e))} ${r(E(e) + n)}`;
|
|
1981
|
+
};
|
|
1982
|
+
return {
|
|
1983
|
+
width: w,
|
|
1984
|
+
height: T,
|
|
1985
|
+
body: [
|
|
1986
|
+
z.map((e) => _`<polygon class="lintje-radar__ring" points=${R(e)} />`),
|
|
1987
|
+
c.map((e, n) => {
|
|
1988
|
+
if (!e) return u;
|
|
1989
|
+
let r = E(n), i = -Math.sin(r) * 5, a = Math.cos(r) * 5, o = F(n, M);
|
|
1990
|
+
return _`<polygon class="lintje-radar__gap" fill="url(#hatch-${t.id})"
|
|
1991
|
+
points=${`${N + i},${P + a} ${o.x + i},${o.y + a} ${o.x - i},${o.y - a} ${N - i},${P - a}`} />`;
|
|
1992
|
+
}),
|
|
1993
|
+
v.map((e, t) => {
|
|
1994
|
+
let n = F(t, M + lt);
|
|
1995
|
+
return _`<line class="lintje-radar__spoke ${V === t ? "is-active" : ""}"
|
|
1996
|
+
x1=${N} y1=${P} x2=${n.x} y2=${n.y} />`;
|
|
1997
|
+
}),
|
|
1998
|
+
z.map((e) => {
|
|
1999
|
+
let t = F(0, I(e));
|
|
2000
|
+
return _`<text x=${t.x + ht / 2} y=${t.y + 4}
|
|
2001
|
+
class="lintje-chart__axis-label lintje-chart__axis-label--halo">${l(e, B)}</text>`;
|
|
2002
|
+
}),
|
|
2003
|
+
b == null ? u : _`<polygon class="lintje-chart__reference lintje-radar__norm" points=${R(b)} />`,
|
|
2004
|
+
ee.map((e) => K(e, "area")),
|
|
2005
|
+
ee.map((e) => K(e, "line")),
|
|
2006
|
+
o == null ? u : K(r.find((e) => e.label === o), "lift"),
|
|
2007
|
+
G,
|
|
2008
|
+
V == null ? u : i.map((e) => {
|
|
2009
|
+
let t = e.values[V];
|
|
2010
|
+
if (t == null) return u;
|
|
2011
|
+
let n = F(V, I(t)), r = e.comparison ? void 0 : H(e.color), i = j(e.symbol, mt, n.x, n.y);
|
|
2012
|
+
return _`
|
|
2013
|
+
<path class="lintje-chart__hover-point" d=${i} fill=${e.color} />
|
|
2014
|
+
${r ? _`<path class="lintje-chart__hover-casing" d=${i} stroke=${r} />` : u}
|
|
2015
|
+
`;
|
|
2016
|
+
}),
|
|
2017
|
+
_`<g @mouseleave=${() => t.hoverAt(null)}>
|
|
2018
|
+
${v.map((e, n) => _`<polygon class="lintje-chart__hit" points=${q(n)}
|
|
2019
|
+
@mousemove=${(e) => t.hoverAt(n, e, g(n))} />`)}
|
|
2020
|
+
</g>`
|
|
2021
|
+
],
|
|
2022
|
+
at: U
|
|
2023
|
+
};
|
|
2024
|
+
}
|
|
2025
|
+
function Ot({ spec: e, controller: t, layers: n, shown: r, reserve: i, labelled: a, hidden: o, format: c, contentAt: d }) {
|
|
2026
|
+
let { axes: f, max: p, threshold: m } = e;
|
|
2027
|
+
t.measure({ width: !0 });
|
|
2028
|
+
let g = t.width, v = g - 1, y = n.filter((e) => !e.comparison), b = [...y.map((e) => ({
|
|
2029
|
+
layer: e,
|
|
2030
|
+
size: y.length === 1 ? 8 : 6
|
|
2031
|
+
})), ...n.filter((e) => e.comparison).map((e) => ({
|
|
2032
|
+
layer: e,
|
|
2033
|
+
size: 4
|
|
2034
|
+
}))], x = b.reduce((e, t) => e + t.size, 0) + bt * Math.max(0, b.length - 1), S = 22 + x + yt, C = f.length * S, w = C + 16, T = (e) => .5 + Math.max(0, Math.min(e, p)) / p * v, E = t.fontFamily, D = n.find((e) => !e.comparison), O = r.find((e) => !e.comparison), k = t.hoverIndex, A = (e) => {
|
|
2035
|
+
let t = O?.values[e];
|
|
2036
|
+
return {
|
|
2037
|
+
x: t == null ? g / 2 : T(t),
|
|
2038
|
+
y: e * S + dt + 4
|
|
2039
|
+
};
|
|
2040
|
+
}, j = f.map((e, n) => {
|
|
2041
|
+
let r = n * S, l = r + dt + 4, p = i ? D?.values[n] : void 0, y = i ? p == null ? "geen gegevens" : c(p) : "", C = i && p != null && m != null && p < m, w = a ? "" : "is-hidden", O = l;
|
|
2042
|
+
return _`
|
|
2043
|
+
<g class="lintje-radar__row ${k === n ? "is-active" : ""}">
|
|
2044
|
+
<text x="0" y=${r + 14} class="lintje-radar__name">${e}</text>
|
|
2045
|
+
${i ? _`<text x=${g} y=${r + 14} text-anchor="end"
|
|
2046
|
+
class="lintje-chart__data-label lintje-radar__value ${p == null ? "lintje-radar__no-value" : ""} ${w}">${y}</text>` : u}
|
|
2047
|
+
${C ? _`<text x=${g - h(y, E, 700) - 6} y=${r + 14} text-anchor="end"
|
|
2048
|
+
class="lintje-chart__axis-label lintje-radar__value ${w}">onder norm</text>` : u}
|
|
2049
|
+
${b.map(({ layer: e, size: r }) => {
|
|
2050
|
+
let i = O;
|
|
2051
|
+
O += r + bt;
|
|
2052
|
+
let a = e.values[n], c = o(e) ? "is-hidden" : "";
|
|
2053
|
+
return a == null ? _`<rect class="lintje-radar__bar ${c}" x="0.5" y=${i} width=${v} height=${r}
|
|
2054
|
+
fill="url(#hatch-${t.id})" />` : _`<rect class="lintje-chart__bar lintje-chart__bar--horizontal lintje-radar__bar ${c}" x="0.5" y=${i}
|
|
2055
|
+
width=${Math.max(0, T(a) - .5)} height=${r} fill=${e.color}
|
|
2056
|
+
${s(B(n, f.length))} />`;
|
|
2057
|
+
})}
|
|
2058
|
+
<line class="lintje-radar__zero" x1="0.5" x2="0.5" y1=${l - 2} y2=${l + x + 2} />
|
|
2059
|
+
${m == null ? u : _`<line class="lintje-chart__reference lintje-radar__norm" x1=${T(m)} x2=${T(m)}
|
|
2060
|
+
y1=${l - 3} y2=${l + x + 3} />`}
|
|
2061
|
+
<rect class="lintje-chart__hit" x="0" y=${r} width=${g} height=${S}
|
|
2062
|
+
@mousemove=${(e) => t.hoverAt(n, e, d(n))} />
|
|
2063
|
+
</g>
|
|
2064
|
+
`;
|
|
2065
|
+
}), M = [0, ...Ct(p, e.step)], N = Math.max(0, ...M.map(wt)), P = M.map((e, t) => _`<text x=${T(e)} y=${C + 12}
|
|
2066
|
+
text-anchor=${t === 0 ? "start" : t === M.length - 1 ? "end" : "middle"}
|
|
2067
|
+
class="lintje-chart__axis-label">${l(e, N)}</text>`);
|
|
2068
|
+
return {
|
|
2069
|
+
width: g,
|
|
2070
|
+
height: w,
|
|
2071
|
+
body: _`<g @mouseleave=${() => t.hoverAt(null)}>${j}</g>${P}`,
|
|
2072
|
+
at: A
|
|
2073
|
+
};
|
|
2074
|
+
}
|
|
2075
|
+
//#endregion
|
|
1546
2076
|
//#region src/components/shared/charts/shared/render-chart.ts
|
|
1547
|
-
function
|
|
2077
|
+
function kt(e, t) {
|
|
1548
2078
|
switch (e.kind) {
|
|
1549
2079
|
case "line": return se(e, t);
|
|
1550
|
-
case "bar": return
|
|
1551
|
-
case "horizontal-bar": return
|
|
1552
|
-
case "target-progress": return
|
|
1553
|
-
case "grouped-bar": return
|
|
1554
|
-
case "stacked-bar": return
|
|
1555
|
-
case "
|
|
1556
|
-
case "
|
|
1557
|
-
case "
|
|
1558
|
-
case "
|
|
1559
|
-
case "
|
|
2080
|
+
case "bar": return de(e, t);
|
|
2081
|
+
case "horizontal-bar": return pe(e, t);
|
|
2082
|
+
case "target-progress": return me(e, t);
|
|
2083
|
+
case "grouped-bar": return he(e, t);
|
|
2084
|
+
case "stacked-bar": return ye(e, t);
|
|
2085
|
+
case "stacked-area": return Te(e, t);
|
|
2086
|
+
case "pie": return Ae(e, t);
|
|
2087
|
+
case "dual-axis": return je(e, t);
|
|
2088
|
+
case "scatter": return Ve(e, t);
|
|
2089
|
+
case "heatmap": return et(e, t);
|
|
2090
|
+
case "histogram": return ct(e, t);
|
|
2091
|
+
case "radar": return Et(e, t);
|
|
1560
2092
|
}
|
|
1561
2093
|
}
|
|
1562
2094
|
//#endregion
|
|
1563
2095
|
//#region src/components/charts/chart/chart.css?inline
|
|
1564
|
-
var
|
|
2096
|
+
var At = "/* ------------------------------------------------------------------------ */\n\n.lintje-chart__view { flex: none; }\n\n/* Below 768 px it is a row of its own at the touch height. */\n@media screen and (max-width: 767px) {\n .lintje-chart__view { --h-control: var(--h-touch); width: 100%; }\n}\n", jt = ".lintje-chart__svg, .lintje-pie-chart__svg", Mt = [{
|
|
1565
2097
|
value: "chart",
|
|
1566
2098
|
label: "Grafiek"
|
|
1567
2099
|
}, {
|
|
1568
2100
|
value: "table",
|
|
1569
2101
|
label: "Tabel"
|
|
1570
2102
|
}];
|
|
1571
|
-
function
|
|
2103
|
+
function Nt(e) {
|
|
1572
2104
|
return (e ?? "").normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "grafiek";
|
|
1573
2105
|
}
|
|
1574
|
-
function
|
|
2106
|
+
function Pt(e) {
|
|
1575
2107
|
switch (e.kind) {
|
|
1576
2108
|
case "line":
|
|
2109
|
+
case "stacked-area":
|
|
1577
2110
|
case "dual-axis":
|
|
1578
2111
|
case "scatter": return "line";
|
|
1579
2112
|
case "pie": return e.donut ? "donut" : "pie";
|
|
2113
|
+
case "radar": return "pie";
|
|
1580
2114
|
case "heatmap": return "heatmap";
|
|
1581
2115
|
default: return "bar";
|
|
1582
2116
|
}
|
|
1583
2117
|
}
|
|
1584
|
-
function
|
|
2118
|
+
function Ft(e) {
|
|
1585
2119
|
switch (e.kind) {
|
|
1586
2120
|
case "horizontal-bar":
|
|
1587
|
-
case "target-progress": return e.rows.length ? `${
|
|
2121
|
+
case "target-progress": return e.rows.length ? `${fe(e.rows.length)}px` : void 0;
|
|
1588
2122
|
case "pie":
|
|
1589
2123
|
case "heatmap": return;
|
|
1590
2124
|
default: return e.small ? "var(--chart-h-small)" : void 0;
|
|
1591
2125
|
}
|
|
1592
2126
|
}
|
|
1593
|
-
function
|
|
2127
|
+
function It(e) {
|
|
1594
2128
|
switch (e.kind) {
|
|
1595
|
-
case "line":
|
|
2129
|
+
case "line": {
|
|
2130
|
+
let t = e.events ?? [], n = (e) => t.filter((t) => t.index === e).map((e) => e.label).join("; ");
|
|
2131
|
+
return [[
|
|
2132
|
+
"",
|
|
2133
|
+
...e.series.map((e) => e.label),
|
|
2134
|
+
...t.length ? ["Gebeurtenis"] : []
|
|
2135
|
+
], ...e.labels.map((r, i) => [
|
|
2136
|
+
r,
|
|
2137
|
+
...e.series.map((e) => e.values[i]),
|
|
2138
|
+
...t.length ? [n(i)] : []
|
|
2139
|
+
])];
|
|
2140
|
+
}
|
|
1596
2141
|
case "bar": return [[
|
|
1597
2142
|
"",
|
|
1598
2143
|
e.axisTitle ?? "Waarde",
|
|
@@ -1614,6 +2159,18 @@ function st(e) {
|
|
|
1614
2159
|
])];
|
|
1615
2160
|
case "grouped-bar":
|
|
1616
2161
|
case "stacked-bar": return [["", ...e.series.map((e) => e.label)], ...e.labels.map((t, n) => [t, ...e.series.map((e) => e.values[n])])];
|
|
2162
|
+
case "stacked-area": return [[
|
|
2163
|
+
"",
|
|
2164
|
+
...e.series.map((e) => e.label),
|
|
2165
|
+
"Totaal"
|
|
2166
|
+
], ...e.labels.map((t, n) => {
|
|
2167
|
+
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(Lt(r)));
|
|
2168
|
+
return [
|
|
2169
|
+
t,
|
|
2170
|
+
...r,
|
|
2171
|
+
i
|
|
2172
|
+
];
|
|
2173
|
+
})];
|
|
1617
2174
|
case "pie": return [["", "Aantal"], ...e.segments.map((e) => [e.label, e.value])];
|
|
1618
2175
|
case "dual-axis": {
|
|
1619
2176
|
let t = (e) => e.unit ? `${e.label} (${e.unit})` : e.label;
|
|
@@ -1645,6 +2202,18 @@ function st(e) {
|
|
|
1645
2202
|
]))];
|
|
1646
2203
|
}
|
|
1647
2204
|
case "heatmap": return [["", ...e.columnLabels], ...e.rowLabels.map((t, n) => [t, ...e.values[n] ?? []])];
|
|
2205
|
+
case "radar": {
|
|
2206
|
+
let t = e.threshold == null ? [] : [e.thresholdLabel ?? "Norm"];
|
|
2207
|
+
return [[
|
|
2208
|
+
"",
|
|
2209
|
+
...e.series.map((e) => e.label),
|
|
2210
|
+
...t
|
|
2211
|
+
], ...e.axes.map((t, n) => [
|
|
2212
|
+
t,
|
|
2213
|
+
...e.series.map((e) => e.values[n] ?? null),
|
|
2214
|
+
...e.threshold == null ? [] : [e.threshold]
|
|
2215
|
+
])];
|
|
2216
|
+
}
|
|
1648
2217
|
case "histogram": {
|
|
1649
2218
|
let t = (t) => e.unit ? `${t} (${e.unit})` : t;
|
|
1650
2219
|
return [[
|
|
@@ -1653,7 +2222,7 @@ function st(e) {
|
|
|
1653
2222
|
t("Tot"),
|
|
1654
2223
|
"Aantal"
|
|
1655
2224
|
], ...e.bins.map((t) => [
|
|
1656
|
-
|
|
2225
|
+
ot(t, e.unit),
|
|
1657
2226
|
t.from,
|
|
1658
2227
|
t.to ?? "",
|
|
1659
2228
|
t.count
|
|
@@ -1661,15 +2230,15 @@ function st(e) {
|
|
|
1661
2230
|
}
|
|
1662
2231
|
}
|
|
1663
2232
|
}
|
|
1664
|
-
function
|
|
2233
|
+
function Lt(e) {
|
|
1665
2234
|
return e.reduce((e, t) => {
|
|
1666
2235
|
if (typeof t != "number" || Number.isInteger(t)) return e;
|
|
1667
2236
|
let n = String(t).split(".")[1] ?? "";
|
|
1668
2237
|
return Math.max(e, n.length);
|
|
1669
2238
|
}, 0);
|
|
1670
2239
|
}
|
|
1671
|
-
function
|
|
1672
|
-
let [n = [], ...r] =
|
|
2240
|
+
function Rt(e, t) {
|
|
2241
|
+
let [n = [], ...r] = It(e), i = n.map((e, t) => {
|
|
1673
2242
|
let n = r.map((e) => e[t] ?? null);
|
|
1674
2243
|
return t === 0 || n.some((e) => typeof e == "string" && e !== "") ? {
|
|
1675
2244
|
key: `c${t}`,
|
|
@@ -1680,7 +2249,7 @@ function lt(e, t) {
|
|
|
1680
2249
|
key: `c${t}`,
|
|
1681
2250
|
header: String(e ?? ""),
|
|
1682
2251
|
format: "decimal",
|
|
1683
|
-
decimals:
|
|
2252
|
+
decimals: Lt(n),
|
|
1684
2253
|
align: "right",
|
|
1685
2254
|
sortable: !1
|
|
1686
2255
|
};
|
|
@@ -1700,18 +2269,17 @@ function lt(e, t) {
|
|
|
1700
2269
|
pageSize: Math.max(r.length, 1)
|
|
1701
2270
|
};
|
|
1702
2271
|
}
|
|
1703
|
-
var
|
|
2272
|
+
var zt = class extends C {
|
|
1704
2273
|
constructor(...e) {
|
|
1705
|
-
super(...e), this.view = "chart", this.#e = new
|
|
2274
|
+
super(...e), this.view = "chart", this.#e = new G(() => this.requestUpdate()), this.#t = null, this.#n = new n(this);
|
|
1706
2275
|
}
|
|
1707
2276
|
static {
|
|
1708
2277
|
this.styles = [
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
r
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
r(tt)
|
|
2278
|
+
e,
|
|
2279
|
+
a(x),
|
|
2280
|
+
a(r),
|
|
2281
|
+
...w,
|
|
2282
|
+
a(At)
|
|
1715
2283
|
];
|
|
1716
2284
|
}
|
|
1717
2285
|
static {
|
|
@@ -1740,36 +2308,40 @@ var ut = class extends S {
|
|
|
1740
2308
|
}
|
|
1741
2309
|
get downloadName() {
|
|
1742
2310
|
let e = this.data?.download;
|
|
1743
|
-
return e === !1 ? null : e?.filename ??
|
|
2311
|
+
return e === !1 ? null : e?.filename ?? Nt(this.data?.title);
|
|
1744
2312
|
}
|
|
1745
2313
|
csv() {
|
|
1746
2314
|
let e = this.data, t = this.downloadName;
|
|
1747
|
-
e && t !== null &&
|
|
2315
|
+
e && t !== null && E(t, It(e.chart));
|
|
1748
2316
|
}
|
|
1749
2317
|
png() {
|
|
1750
2318
|
let e = this.data;
|
|
1751
2319
|
if (!e) return;
|
|
1752
|
-
let t = this.renderRoot.querySelector(this.expanded ? "lintje-modal" : "lintje-tile")?.querySelector(
|
|
1753
|
-
t &&
|
|
2320
|
+
let t = this.renderRoot.querySelector(this.expanded ? "lintje-modal" : "lintje-tile")?.querySelector(jt);
|
|
2321
|
+
t && T(this.downloadName ?? Nt(e.title), t);
|
|
1754
2322
|
}
|
|
1755
2323
|
expandChanged(e) {
|
|
1756
|
-
e ? this.#t ??= new
|
|
2324
|
+
e ? this.#t ??= new G(() => this.requestUpdate()) : (this.#t?.detach(), this.#t = null);
|
|
1757
2325
|
}
|
|
1758
2326
|
render() {
|
|
1759
2327
|
let e = this.data;
|
|
1760
|
-
if (!e) return
|
|
1761
|
-
let t = this.ready,
|
|
1762
|
-
return
|
|
1763
|
-
id=${
|
|
1764
|
-
span=${e.span ??
|
|
1765
|
-
heading=${e.title ??
|
|
1766
|
-
icon=${e.icon ??
|
|
1767
|
-
subtitle=${
|
|
1768
|
-
intro=${e.intro ??
|
|
1769
|
-
footnote=${e.footnote ??
|
|
2328
|
+
if (!e) return u;
|
|
2329
|
+
let t = this.ready, n = this.#n.matches && e.mobileSubtitle ? e.mobileSubtitle : e.subtitle, r = this.id ? `${this.id}-tile` : void 0, i = e.tableSwitch && t ? this.viewSwitch() : u, a = this.showsTable;
|
|
2330
|
+
return p`<lintje-tile
|
|
2331
|
+
id=${r ?? u}
|
|
2332
|
+
span=${e.span ?? u}
|
|
2333
|
+
heading=${e.title ?? u}
|
|
2334
|
+
icon=${e.icon ?? u}
|
|
2335
|
+
subtitle=${n ?? u}
|
|
2336
|
+
intro=${e.intro ?? u}
|
|
2337
|
+
footnote=${e.footnote ?? u}
|
|
1770
2338
|
?legend-below=${!!e.legendBelow}
|
|
1771
2339
|
?expandable=${this.expandable && t}
|
|
1772
2340
|
?download=${this.downloadName !== null && t}
|
|
2341
|
+
state=${e.state ?? "ready"}
|
|
2342
|
+
message=${e.message ?? u}
|
|
2343
|
+
last-known=${e.lastKnown ?? u}
|
|
2344
|
+
content-height=${Ft(e.chart) ?? u}
|
|
1773
2345
|
@lintje-tile-expand=${(e) => {
|
|
1774
2346
|
e.stopPropagation(), this.expand(!0);
|
|
1775
2347
|
}}
|
|
@@ -1777,53 +2349,51 @@ var ut = class extends S {
|
|
|
1777
2349
|
e.stopPropagation(), this.csv();
|
|
1778
2350
|
}}
|
|
1779
2351
|
>
|
|
1780
|
-
${
|
|
1781
|
-
${e.notice ?
|
|
2352
|
+
${i}
|
|
2353
|
+
${e.notice ? p`<lintje-announcement
|
|
1782
2354
|
slot="notice"
|
|
1783
2355
|
compact
|
|
1784
2356
|
.data=${e.notice}
|
|
1785
|
-
></lintje-announcement>` :
|
|
2357
|
+
></lintje-announcement>` : u}
|
|
1786
2358
|
${this.content()}
|
|
1787
2359
|
</lintje-tile>
|
|
1788
2360
|
|
|
1789
|
-
${this.renderExpandModal(this.expanded ?
|
|
2361
|
+
${this.renderExpandModal(this.expanded ? a ? this.table() : this.#t ? kt(e.chart, {
|
|
1790
2362
|
...this.chartOptions(this.#t),
|
|
1791
2363
|
expanded: !0
|
|
1792
|
-
}) :
|
|
2364
|
+
}) : u : u, {
|
|
1793
2365
|
heading: e.title,
|
|
1794
|
-
subtitle:
|
|
2366
|
+
subtitle: n,
|
|
1795
2367
|
footnote: e.footnote,
|
|
1796
2368
|
csv: () => this.csv(),
|
|
1797
|
-
png:
|
|
2369
|
+
png: a ? void 0 : () => this.png()
|
|
1798
2370
|
})}`;
|
|
1799
2371
|
}
|
|
1800
2372
|
content() {
|
|
1801
|
-
let e = this.data
|
|
2373
|
+
let e = this.data;
|
|
1802
2374
|
switch (e.state ?? "ready") {
|
|
1803
|
-
case "loading": return
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
});
|
|
1814
|
-
default: return this.showsTable ? this.table() : et(e.chart, this.chartOptions(this.#e));
|
|
2375
|
+
case "loading": return p`<div slot="loading">
|
|
2376
|
+
${S({
|
|
2377
|
+
kind: Pt(e.chart),
|
|
2378
|
+
height: Ft(e.chart),
|
|
2379
|
+
status: !1
|
|
2380
|
+
})}
|
|
2381
|
+
</div>`;
|
|
2382
|
+
case "empty":
|
|
2383
|
+
case "error": return u;
|
|
2384
|
+
default: return this.showsTable ? this.table() : kt(e.chart, this.chartOptions(this.#e));
|
|
1815
2385
|
}
|
|
1816
2386
|
}
|
|
1817
2387
|
viewSwitch() {
|
|
1818
2388
|
let e = this.#n.matches;
|
|
1819
|
-
return
|
|
2389
|
+
return p`<lintje-segmented
|
|
1820
2390
|
class="lintje-chart__view"
|
|
1821
2391
|
slot=${e ? "notice" : "actions"}
|
|
1822
2392
|
label="Weergave"
|
|
1823
2393
|
hide-label
|
|
1824
2394
|
?stacked=${e}
|
|
1825
2395
|
.value=${this.view}
|
|
1826
|
-
.options=${
|
|
2396
|
+
.options=${Mt}
|
|
1827
2397
|
@lintje-change=${(e) => {
|
|
1828
2398
|
e.stopPropagation(), this.view = e.detail === "table" ? "table" : "chart";
|
|
1829
2399
|
}}
|
|
@@ -1831,15 +2401,15 @@ var ut = class extends S {
|
|
|
1831
2401
|
}
|
|
1832
2402
|
table() {
|
|
1833
2403
|
let e = this.data, t = e.title ? `${e.title}, als tabel` : "Grafiek als tabel";
|
|
1834
|
-
return
|
|
2404
|
+
return p`<lintje-data-table
|
|
1835
2405
|
class="lintje-chart__table"
|
|
1836
2406
|
bare
|
|
1837
|
-
.data=${
|
|
2407
|
+
.data=${Rt(e.chart, t)}
|
|
1838
2408
|
></lintje-data-table>`;
|
|
1839
2409
|
}
|
|
1840
2410
|
async focusMark(e) {
|
|
1841
2411
|
await this.updateComplete;
|
|
1842
|
-
let t = this.renderRoot.querySelector(this.expanded ? "lintje-modal" : "lintje-tile"), n = t?.querySelector(`[data-mark-id="${CSS.escape(e)}"]`) ?? t?.querySelector(`${
|
|
2412
|
+
let t = this.renderRoot.querySelector(this.expanded ? "lintje-modal" : "lintje-tile"), n = t?.querySelector(`[data-mark-id="${CSS.escape(e)}"]`) ?? t?.querySelector(`${jt}, .lintje-heatmap`);
|
|
1843
2413
|
n && !n.hasAttribute("tabindex") && n.setAttribute("tabindex", "-1"), n?.focus();
|
|
1844
2414
|
}
|
|
1845
2415
|
chartOptions(e) {
|
|
@@ -1863,6 +2433,6 @@ var ut = class extends S {
|
|
|
1863
2433
|
};
|
|
1864
2434
|
}
|
|
1865
2435
|
};
|
|
1866
|
-
|
|
2436
|
+
i("lintje-chart", zt);
|
|
1867
2437
|
//#endregion
|
|
1868
|
-
export {
|
|
2438
|
+
export { zt as LintjeChart };
|