origam 2.38.0 → 2.38.2
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/CHANGELOG.md +34 -0
- package/dist/src/assets/locales/en.json +1 -1
- package/dist/src/assets/locales/fr.json +2 -2
- package/dist/src/components/Alert/OrigamAlert.vue +739 -165
- package/dist/src/components/App/OrigamApp.vue +95 -19
- package/dist/src/components/App/OrigamAppBar.vue +751 -158
- package/dist/src/components/Audio/OrigamAudio.vue +1288 -346
- package/dist/src/components/Audio/OrigamAudioWaveform.vue +63 -7
- package/dist/src/components/Avatar/OrigamAvatar.vue +678 -126
- package/dist/src/components/Avatar/OrigamAvatarGroup.vue +700 -153
- package/dist/src/components/Badge/OrigamBadge.vue +548 -135
- package/dist/src/components/Blockquote/OrigamBlockquote.vue +698 -140
- package/dist/src/components/BottomNav/OrigamBottomNav.vue +864 -156
- package/dist/src/components/Bracket/OrigamBracket.vue +1013 -380
- package/dist/src/components/Bracket/OrigamBracketCompetitor.vue +674 -154
- package/dist/src/components/Bracket/OrigamBracketMatch.vue +663 -163
- package/dist/src/components/Bracket/OrigamBracketRound.vue +116 -34
- package/dist/src/components/Breadcrumb/OrigamBreadcrumb.vue +654 -119
- package/dist/src/components/Breadcrumb/OrigamBreadcrumbDivider.vue +292 -54
- package/dist/src/components/Breadcrumb/OrigamBreadcrumbItem.vue +657 -126
- package/dist/src/components/Btn/OrigamBtn.vue +928 -249
- package/dist/src/components/Btn/OrigamBtnGroup.vue +658 -141
- package/dist/src/components/Btn/OrigamBtnToggle.vue +578 -91
- package/dist/src/components/Calendar/OrigamCalendar.vue +1142 -484
- package/dist/src/components/Card/OrigamCard.vue +938 -194
- package/dist/src/components/Card/OrigamCardHeader.vue +593 -104
- package/dist/src/components/Card/OrigamCardText.vue +536 -84
- package/dist/src/components/Carousel/OrigamCarousel.vue +778 -202
- package/dist/src/components/Carousel/OrigamCarouselItem.vue +660 -109
- package/dist/src/components/Chart/OrigamChart.vue +942 -452
- package/dist/src/components/Chart/OrigamChartAxis.vue +111 -19
- package/dist/src/components/Chart/OrigamChartBoxPlot.vue +713 -297
- package/dist/src/components/Chart/OrigamChartBullet.vue +701 -286
- package/dist/src/components/Chart/OrigamChartCandlestick.vue +663 -243
- package/dist/src/components/Chart/OrigamChartCartesian.vue +1055 -487
- package/dist/src/components/Chart/OrigamChartGauge.vue +563 -164
- package/dist/src/components/Chart/OrigamChartHeatmap.vue +677 -251
- package/dist/src/components/Chart/OrigamChartHoneycomb.vue +700 -288
- package/dist/src/components/Chart/OrigamChartLegend.vue +108 -16
- package/dist/src/components/Chart/OrigamChartMap.vue +723 -299
- package/dist/src/components/Chart/OrigamChartPareto.vue +721 -276
- package/dist/src/components/Chart/OrigamChartPictorial.vue +777 -355
- package/dist/src/components/Chart/OrigamChartPolar.vue +603 -210
- package/dist/src/components/Chart/OrigamChartPolarBar.vue +674 -271
- package/dist/src/components/Chart/OrigamChartPyramid.vue +685 -250
- package/dist/src/components/Chart/OrigamChartRadar.vue +515 -165
- package/dist/src/components/Chart/OrigamChartRangeSelector.vue +50 -25
- package/dist/src/components/Chart/OrigamChartSankey.vue +913 -467
- package/dist/src/components/Chart/OrigamChartSparkline.vue +711 -268
- package/dist/src/components/Chart/OrigamChartStreamgraph.vue +810 -368
- package/dist/src/components/Chart/OrigamChartSunburst.vue +779 -368
- package/dist/src/components/Chart/OrigamChartTooltip.vue +78 -19
- package/dist/src/components/Chart/OrigamChartTreemap.vue +750 -288
- package/dist/src/components/Chart/OrigamChartVariwide.vue +679 -251
- package/dist/src/components/Chart/OrigamChartWordCloud.vue +674 -265
- package/dist/src/components/Checkbox/OrigamCheckbox.vue +781 -136
- package/dist/src/components/Checkbox/OrigamCheckboxBtn.vue +465 -81
- package/dist/src/components/Checkbox/OrigamCheckboxGroup.vue +824 -137
- package/dist/src/components/Chip/OrigamChip.vue +867 -202
- package/dist/src/components/Chip/OrigamChipGroup.vue +633 -121
- package/dist/src/components/ClientOnly/OrigamClientOnly.vue +30 -4
- package/dist/src/components/Clipboard/OrigamClipboard.vue +624 -105
- package/dist/src/components/Code/OrigamCode.vue +844 -206
- package/dist/src/components/CodeGroup/OrigamCodeGroup.vue +494 -83
- package/dist/src/components/ColorPicker/OrigamColorPicker.vue +777 -159
- package/dist/src/components/ColorPicker/OrigamColorPickerCanvas.vue +295 -181
- package/dist/src/components/ColorPicker/OrigamColorPickerEdit.vue +108 -45
- package/dist/src/components/ColorPicker/OrigamColorPickerPreview.vue +131 -46
- package/dist/src/components/ColorPicker/OrigamColorPickerSwatches.vue +128 -39
- package/dist/src/components/ColorPickerField/OrigamColorPickerField.vue +1123 -258
- package/dist/src/components/CommandPalette/OrigamCommandPalette.vue +415 -162
- package/dist/src/components/ConfirmWrapper/OrigamConfirmWrapper.vue +389 -145
- package/dist/src/components/ContextualMenu/OrigamContextualMenu.vue +852 -147
- package/dist/src/components/Counter/OrigamCounter.vue +588 -96
- package/dist/src/components/DataList/OrigamDataList.vue +619 -113
- package/dist/src/components/DataList/OrigamDataText.vue +295 -65
- package/dist/src/components/DataList/OrigamDataTitle.vue +295 -65
- package/dist/src/components/DataTable/OrigamDataTable.vue +934 -222
- package/dist/src/components/DataTable/OrigamDataTableColumnCell.vue +196 -51
- package/dist/src/components/DataTable/OrigamDataTableFooter.vue +319 -78
- package/dist/src/components/DataTable/OrigamDataTableGroupHeaderRow.vue +124 -44
- package/dist/src/components/DataTable/OrigamDataTableHeaderCell.vue +181 -70
- package/dist/src/components/DataTable/OrigamDataTableHeaders.vue +155 -46
- package/dist/src/components/DataTable/OrigamDataTableHeadersCell.vue +145 -27
- package/dist/src/components/DataTable/OrigamDataTableHeadersCellMobile.vue +126 -43
- package/dist/src/components/DataTable/OrigamDataTableRow.vue +151 -73
- package/dist/src/components/DataTable/OrigamDataTableRows.vue +261 -106
- package/dist/src/components/DatePicker/OrigamDatePicker.vue +1048 -261
- package/dist/src/components/DatePicker/OrigamDatePickerControls.vue +155 -51
- package/dist/src/components/DatePicker/OrigamDatePickerHeader.vue +147 -46
- package/dist/src/components/DatePicker/OrigamDatePickerMonth.vue +312 -134
- package/dist/src/components/DatePicker/OrigamDatePickerMonths.vue +151 -61
- package/dist/src/components/DatePicker/OrigamDatePickerYears.vue +154 -67
- package/dist/src/components/DatePickerField/OrigamDatePickerField.vue +1147 -306
- package/dist/src/components/DefaultsProvider/OrigamDefaultsProvider.vue +74 -14
- package/dist/src/components/Dialog/OrigamDialog.vue +953 -196
- package/dist/src/components/Dialog/OrigamDialogConfirmation.vue +886 -148
- package/dist/src/components/Divider/OrigamDivider.vue +210 -50
- package/dist/src/components/Drawer/OrigamDrawer.vue +909 -207
- package/dist/src/components/EmptyState/OrigamEmptyState.vue +146 -35
- package/dist/src/components/ExpansionPanel/OrigamExpansionPanel.vue +746 -159
- package/dist/src/components/ExpansionPanel/OrigamExpansionPanelContent.vue +591 -95
- package/dist/src/components/ExpansionPanel/OrigamExpansionPanelHeader.vue +663 -143
- package/dist/src/components/ExpansionPanel/OrigamExpansionPanels.vue +675 -134
- package/dist/src/components/Field/OrigamField.vue +1118 -306
- package/dist/src/components/FileField/OrigamFileField.vue +1188 -311
- package/dist/src/components/FileField/OrigamFileFieldDragNDropItem.vue +155 -36
- package/dist/src/components/FileField/OrigamFileFieldListItem.vue +155 -36
- package/dist/src/components/Form/OrigamForm.vue +197 -74
- package/dist/src/components/Grid/OrigamGrid.vue +707 -147
- package/dist/src/components/Grid/OrigamGridItem.vue +110 -37
- package/dist/src/components/Grids/OrigamCol.vue +593 -110
- package/dist/src/components/Grids/OrigamContainer.vue +461 -80
- package/dist/src/components/Grids/OrigamRow.vue +573 -112
- package/dist/src/components/Grids/OrigamSpacer.vue +54 -17
- package/dist/src/components/Icon/OrigamClassIcon.vue +573 -98
- package/dist/src/components/Icon/OrigamComponentIcon.vue +561 -101
- package/dist/src/components/Icon/OrigamIcon.vue +561 -98
- package/dist/src/components/Icon/OrigamLigatureIcon.vue +558 -98
- package/dist/src/components/Icon/OrigamSvgIcon.vue +593 -100
- package/dist/src/components/Img/OrigamImg.vue +869 -228
- package/dist/src/components/InfiniteScroll/OrigamInfiniteScroll.vue +319 -111
- package/dist/src/components/InfiniteScroll/OrigamInfiniteScrollIntersect.vue +80 -17
- package/dist/src/components/InlineEdit/OrigamInlineEdit.vue +476 -140
- package/dist/src/components/Input/OrigamInput.vue +747 -180
- package/dist/src/components/ItemGroup/OrigamItemGroup.vue +112 -36
- package/dist/src/components/ItemGroup/OrigamItemGroupItem.vue +80 -29
- package/dist/src/components/Kbd/OrigamKbd.vue +450 -75
- package/dist/src/components/Label/OrigamLabel.vue +584 -95
- package/dist/src/components/Layout/OrigamLayout.vue +563 -94
- package/dist/src/components/Lazy/OrigamLazy.vue +131 -34
- package/dist/src/components/List/OrigamList.vue +755 -170
- package/dist/src/components/List/OrigamListChildren.vue +59 -19
- package/dist/src/components/List/OrigamListGroup.vue +631 -134
- package/dist/src/components/List/OrigamListGroupActivator.vue +45 -17
- package/dist/src/components/List/OrigamListItem.vue +890 -224
- package/dist/src/components/List/OrigamListItemWrapper.vue +20 -10
- package/dist/src/components/List/OrigamListSubheader.vue +542 -93
- package/dist/src/components/Loader/OrigamLoader.vue +110 -25
- package/dist/src/components/Main/OrigamMain.vue +565 -96
- package/dist/src/components/Masonry/OrigamMasonry.vue +799 -187
- package/dist/src/components/Media/OrigamMediaController.vue +465 -182
- package/dist/src/components/Media/OrigamMediaScrubber.vue +389 -152
- package/dist/src/components/Media/OrigamMediaVolumeControl.vue +174 -44
- package/dist/src/components/Menu/OrigamMenu.vue +1079 -255
- package/dist/src/components/Messages/OrigamMessages.vue +606 -97
- package/dist/src/components/NumberField/OrigamNumberField.vue +1208 -333
- package/dist/src/components/NumberFormat/OrigamNumberFormat.vue +177 -57
- package/dist/src/components/OtpInputField/OrigamOtpInputField.vue +1016 -272
- package/dist/src/components/Overlay/OrigamOverlay.vue +446 -158
- package/dist/src/components/Overlay/OrigamOverlayScrim.vue +122 -30
- package/dist/src/components/Pagination/OrigamPagination.vue +982 -313
- package/dist/src/components/Parallax/OrigamParallax.vue +800 -259
- package/dist/src/components/Parallax/OrigamParallaxElement.vue +694 -178
- package/dist/src/components/Parallax/OrigamParallaxLayer.vue +132 -47
- package/dist/src/components/PasswordField/OrigamPasswordField.vue +1098 -265
- package/dist/src/components/Picker/OrigamPicker.vue +655 -108
- package/dist/src/components/Picker/OrigamPickerTitle.vue +108 -26
- package/dist/src/components/Progress/OrigamProgress.vue +436 -70
- package/dist/src/components/Progress/OrigamProgressCircular.vue +399 -82
- package/dist/src/components/Progress/OrigamProgressLinear.vue +468 -115
- package/dist/src/components/QrCode/OrigamQrCode.vue +642 -126
- package/dist/src/components/Radio/OrigamRadio.vue +772 -132
- package/dist/src/components/Radio/OrigamRadioBtn.vue +446 -71
- package/dist/src/components/Radio/OrigamRadioGroup.vue +808 -135
- package/dist/src/components/RatingField/OrigamRatingField.vue +963 -194
- package/dist/src/components/RatingField/OrigamRatingFieldItem.vue +657 -106
- package/dist/src/components/Responsive/OrigamResponsive.vue +548 -91
- package/dist/src/components/Select/OrigamSelect.vue +1639 -567
- package/dist/src/components/SelectionControl/OrigamSelectionControl.vue +564 -151
- package/dist/src/components/SelectionControl/OrigamSelectionControlGroup.vue +178 -62
- package/dist/src/components/Sheet/OrigamSheet.vue +773 -199
- package/dist/src/components/Skeleton/OrigamSkeleton.vue +249 -46
- package/dist/src/components/Skeleton/OrigamSkeletonGroup.vue +66 -11
- package/dist/src/components/Slide/OrigamSlideGroup.vue +772 -257
- package/dist/src/components/SliderField/OrigamSliderField.vue +1157 -335
- package/dist/src/components/SliderField/OrigamSliderFieldTrack.vue +236 -112
- package/dist/src/components/Snackbar/OrigamSnackbar.vue +871 -214
- package/dist/src/components/Snackbar/OrigamSnackbarGroup.vue +218 -51
- package/dist/src/components/Snackbar/OrigamSnackbarItem.vue +175 -43
- package/dist/src/components/Stepper/OrigamStepper.vue +618 -126
- package/dist/src/components/Stepper/OrigamStepperItem.vue +98 -37
- package/dist/src/components/Switch/OrigamSwitch.vue +879 -156
- package/dist/src/components/Switch/OrigamSwitchTrack.vue +431 -78
- package/dist/src/components/SystemBar/OrigamSystemBar.vue +517 -87
- package/dist/src/components/Table/OrigamTable.vue +585 -124
- package/dist/src/components/Tabs/OrigamTab.vue +239 -73
- package/dist/src/components/Tabs/OrigamTabPanel.vue +125 -39
- package/dist/src/components/Tabs/OrigamTabPanels.vue +148 -57
- package/dist/src/components/Tabs/OrigamTabs.vue +381 -109
- package/dist/src/components/TextField/OrigamTextField.vue +1077 -258
- package/dist/src/components/TextMask/OrigamTextMask.vue +150 -43
- package/dist/src/components/TextareaField/OrigamTextareaField.vue +1162 -310
- package/dist/src/components/TextareaField/OrigamTextareaFieldRichToolbar.vue +77 -79
- package/dist/src/components/ThemeProvider/OrigamThemeProvider.vue +44 -9
- package/dist/src/components/Timeline/OrigamTimeline.vue +113 -43
- package/dist/src/components/Timeline/OrigamTimelineItem.vue +163 -76
- package/dist/src/components/Title/OrigamTitle.vue +505 -82
- package/dist/src/components/Toolbar/OrigamToolbar.vue +679 -142
- package/dist/src/components/Tooltip/OrigamTooltip.vue +288 -72
- package/dist/src/components/Transition/OrigamExpandX.vue +219 -106
- package/dist/src/components/Transition/OrigamExpandY.vue +219 -106
- package/dist/src/components/Transition/OrigamFade.vue +47 -9
- package/dist/src/components/Transition/OrigamReverseTranslatePicker.vue +52 -10
- package/dist/src/components/Transition/OrigamScaleRotate.vue +52 -10
- package/dist/src/components/Transition/OrigamSlideX.vue +52 -10
- package/dist/src/components/Transition/OrigamSlideY.vue +52 -10
- package/dist/src/components/Transition/OrigamSnack.vue +52 -10
- package/dist/src/components/Transition/OrigamTransition.vue +40 -12
- package/dist/src/components/Transition/OrigamTranslateBottom.vue +52 -10
- package/dist/src/components/Transition/OrigamTranslatePicker.vue +52 -10
- package/dist/src/components/Transition/OrigamTranslateScale.vue +209 -97
- package/dist/src/components/Transition/OrigamWindowXReverseTranslate.vue +40 -7
- package/dist/src/components/Transition/OrigamWindowXTranslate.vue +40 -7
- package/dist/src/components/Transition/OrigamWindowYReverseTranslate.vue +40 -7
- package/dist/src/components/Transition/OrigamWindowYTranslate.vue +40 -7
- package/dist/src/components/Treeview/OrigamTreeview.vue +258 -118
- package/dist/src/components/Treeview/OrigamTreeviewNode.vue +126 -88
- package/dist/src/components/Video/OrigamVideo.vue +1178 -331
- package/dist/src/components/VirtualScroll/OrigamVirtualScroll.vue +147 -55
- package/dist/src/components/VirtualScroll/OrigamVirtualScrollItem.vue +94 -19
- package/dist/src/components/Watermark/OrigamWatermark.vue +224 -124
- package/dist/src/components/Window/OrigamWindow.vue +745 -175
- package/dist/src/components/Window/OrigamWindowItem.vue +162 -69
- package/dist/src/composables/Commons/display.composable.cjs +2 -0
- package/dist/src/composables/Commons/display.composable.js +1 -1
- package/dist/src/interfaces/Pagination/pagination.interface.d.ts +1 -1
- package/package.json +8 -8
|
@@ -293,10 +293,7 @@
|
|
|
293
293
|
|
|
294
294
|
<script lang="ts" setup>
|
|
295
295
|
import { CHART_SIZE_FALLBACK, CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
|
|
296
|
-
import {
|
|
297
|
-
computed,
|
|
298
|
-
ref
|
|
299
|
-
} from "vue";
|
|
296
|
+
import { computed, ref } from "vue";
|
|
300
297
|
import OrigamChartLegend from "./OrigamChartLegend.vue";
|
|
301
298
|
import OrigamChartTooltip from "./OrigamChartTooltip.vue";
|
|
302
299
|
import { useUnsupportedProp } from "../../composables/Commons/unsupportedProp.composable";
|
|
@@ -314,77 +311,453 @@ import { useRounded } from "../../composables/Commons/rounded.composable";
|
|
|
314
311
|
import { intentBgExpr, isIntent } from "../../utils/Commons/color.util";
|
|
315
312
|
import { CHART_PICTORIAL_MODE } from "../../enums/Chart/chart-pictorial.enum";
|
|
316
313
|
import { DIRECTION } from "../../enums/Commons/direction.enum";
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
314
|
+
/*********************************************************
|
|
315
|
+
* Global
|
|
316
|
+
*
|
|
317
|
+
* @description
|
|
318
|
+
* Pictorial / isotype chart family. Renders each data value
|
|
319
|
+
* as a column of repeated SVG icons — one icon per N units.
|
|
320
|
+
* Filled icons represent the value; background (empty) icons
|
|
321
|
+
* show the maximum capacity, making partial fills immediately
|
|
322
|
+
* legible ("3 of 4 customers recommend us").
|
|
323
|
+
*
|
|
324
|
+
* Supports vertical (traditional column) and horizontal stacking.
|
|
325
|
+
* Multiple series are rendered side-by-side per category.
|
|
326
|
+
*
|
|
327
|
+
* `withDefaults` literals only, per CLAUDE.md.
|
|
328
|
+
********************************************************/
|
|
329
|
+
defineOptions({ name: "OrigamChartPictorial" });
|
|
320
330
|
const props = defineProps({
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
331
|
+
icon: {
|
|
332
|
+
type: String,
|
|
333
|
+
required: false,
|
|
334
|
+
default: "M12 2a4 4 0 0 1 4 4v1a4 4 0 0 1-8 0V6a4 4 0 0 1 4-4Zm-7 20a7 7 0 0 1 14 0v1H5v-1Z"
|
|
335
|
+
},
|
|
336
|
+
iconColor: {
|
|
337
|
+
type: null,
|
|
338
|
+
required: false,
|
|
339
|
+
default: undefined
|
|
340
|
+
},
|
|
341
|
+
emptyIconColor: {
|
|
342
|
+
type: String,
|
|
343
|
+
required: false,
|
|
344
|
+
default: "rgba(0,0,0,0.1)"
|
|
345
|
+
},
|
|
346
|
+
iconsPerUnit: {
|
|
347
|
+
type: Number,
|
|
348
|
+
required: false,
|
|
349
|
+
default: 1
|
|
350
|
+
},
|
|
351
|
+
direction: {
|
|
352
|
+
type: null,
|
|
353
|
+
required: false,
|
|
354
|
+
default: "vertical"
|
|
355
|
+
},
|
|
356
|
+
mode: {
|
|
357
|
+
type: null,
|
|
358
|
+
required: false,
|
|
359
|
+
default: "stack"
|
|
360
|
+
},
|
|
361
|
+
showLabel: {
|
|
362
|
+
type: Boolean,
|
|
363
|
+
required: false,
|
|
364
|
+
default: true
|
|
365
|
+
},
|
|
366
|
+
showAxis: {
|
|
367
|
+
type: Boolean,
|
|
368
|
+
required: false,
|
|
369
|
+
default: true
|
|
370
|
+
},
|
|
371
|
+
xAxisFormat: {
|
|
372
|
+
type: Function,
|
|
373
|
+
required: false,
|
|
374
|
+
default: undefined
|
|
375
|
+
},
|
|
376
|
+
yAxisFormat: {
|
|
377
|
+
type: Function,
|
|
378
|
+
required: false,
|
|
379
|
+
default: undefined
|
|
380
|
+
},
|
|
381
|
+
series: {
|
|
382
|
+
type: Array,
|
|
383
|
+
required: true
|
|
384
|
+
},
|
|
385
|
+
categories: {
|
|
386
|
+
type: Array,
|
|
387
|
+
required: false,
|
|
388
|
+
default: () => []
|
|
389
|
+
},
|
|
390
|
+
title: {
|
|
391
|
+
type: String,
|
|
392
|
+
required: false,
|
|
393
|
+
default: undefined
|
|
394
|
+
},
|
|
395
|
+
subtitle: {
|
|
396
|
+
type: String,
|
|
397
|
+
required: false,
|
|
398
|
+
default: undefined
|
|
399
|
+
},
|
|
400
|
+
showLegend: {
|
|
401
|
+
type: Boolean,
|
|
402
|
+
required: false,
|
|
403
|
+
default: true
|
|
404
|
+
},
|
|
405
|
+
legendPosition: {
|
|
406
|
+
type: null,
|
|
407
|
+
required: false,
|
|
408
|
+
default: "bottom"
|
|
409
|
+
},
|
|
410
|
+
showTooltip: {
|
|
411
|
+
type: Boolean,
|
|
412
|
+
required: false,
|
|
413
|
+
default: true
|
|
414
|
+
},
|
|
415
|
+
animated: {
|
|
416
|
+
type: Boolean,
|
|
417
|
+
required: false,
|
|
418
|
+
default: true
|
|
419
|
+
},
|
|
420
|
+
animationDuration: {
|
|
421
|
+
type: Number,
|
|
422
|
+
required: false,
|
|
423
|
+
default: 600
|
|
424
|
+
},
|
|
425
|
+
colorScheme: {
|
|
426
|
+
type: Array,
|
|
427
|
+
required: false,
|
|
428
|
+
default: () => []
|
|
429
|
+
},
|
|
430
|
+
aspectRatio: {
|
|
431
|
+
type: String,
|
|
432
|
+
required: false,
|
|
433
|
+
default: undefined
|
|
434
|
+
},
|
|
435
|
+
id: {
|
|
436
|
+
type: String,
|
|
437
|
+
required: false
|
|
438
|
+
},
|
|
439
|
+
class: {
|
|
440
|
+
type: [
|
|
441
|
+
String,
|
|
442
|
+
Array,
|
|
443
|
+
Object
|
|
444
|
+
],
|
|
445
|
+
required: false
|
|
446
|
+
},
|
|
447
|
+
style: {
|
|
448
|
+
type: [
|
|
449
|
+
String,
|
|
450
|
+
Array,
|
|
451
|
+
Object,
|
|
452
|
+
Boolean,
|
|
453
|
+
null
|
|
454
|
+
],
|
|
455
|
+
required: false,
|
|
456
|
+
skipCheck: true
|
|
457
|
+
},
|
|
458
|
+
height: {
|
|
459
|
+
type: [Number, String],
|
|
460
|
+
required: false,
|
|
461
|
+
default: 400
|
|
462
|
+
},
|
|
463
|
+
maxHeight: {
|
|
464
|
+
type: [Number, String],
|
|
465
|
+
required: false
|
|
466
|
+
},
|
|
467
|
+
maxWidth: {
|
|
468
|
+
type: [Number, String],
|
|
469
|
+
required: false
|
|
470
|
+
},
|
|
471
|
+
minHeight: {
|
|
472
|
+
type: [Number, String],
|
|
473
|
+
required: false
|
|
474
|
+
},
|
|
475
|
+
minWidth: {
|
|
476
|
+
type: [Number, String],
|
|
477
|
+
required: false
|
|
478
|
+
},
|
|
479
|
+
width: {
|
|
480
|
+
type: [Number, String],
|
|
481
|
+
required: false
|
|
482
|
+
},
|
|
483
|
+
margin: {
|
|
484
|
+
type: [
|
|
485
|
+
Boolean,
|
|
486
|
+
Number,
|
|
487
|
+
String
|
|
488
|
+
],
|
|
489
|
+
required: false
|
|
490
|
+
},
|
|
491
|
+
marginTop: {
|
|
492
|
+
type: [
|
|
493
|
+
Boolean,
|
|
494
|
+
Number,
|
|
495
|
+
String
|
|
496
|
+
],
|
|
497
|
+
required: false
|
|
498
|
+
},
|
|
499
|
+
marginLeft: {
|
|
500
|
+
type: [
|
|
501
|
+
Boolean,
|
|
502
|
+
Number,
|
|
503
|
+
String
|
|
504
|
+
],
|
|
505
|
+
required: false
|
|
506
|
+
},
|
|
507
|
+
marginBottom: {
|
|
508
|
+
type: [
|
|
509
|
+
Boolean,
|
|
510
|
+
Number,
|
|
511
|
+
String
|
|
512
|
+
],
|
|
513
|
+
required: false
|
|
514
|
+
},
|
|
515
|
+
marginRight: {
|
|
516
|
+
type: [
|
|
517
|
+
Boolean,
|
|
518
|
+
Number,
|
|
519
|
+
String
|
|
520
|
+
],
|
|
521
|
+
required: false
|
|
522
|
+
},
|
|
523
|
+
marginBlock: {
|
|
524
|
+
type: [
|
|
525
|
+
Boolean,
|
|
526
|
+
Number,
|
|
527
|
+
String
|
|
528
|
+
],
|
|
529
|
+
required: false
|
|
530
|
+
},
|
|
531
|
+
marginInline: {
|
|
532
|
+
type: [
|
|
533
|
+
Boolean,
|
|
534
|
+
Number,
|
|
535
|
+
String
|
|
536
|
+
],
|
|
537
|
+
required: false
|
|
538
|
+
},
|
|
539
|
+
marginInlineStart: {
|
|
540
|
+
type: [
|
|
541
|
+
Boolean,
|
|
542
|
+
Number,
|
|
543
|
+
String
|
|
544
|
+
],
|
|
545
|
+
required: false
|
|
546
|
+
},
|
|
547
|
+
marginInlineEnd: {
|
|
548
|
+
type: [
|
|
549
|
+
Boolean,
|
|
550
|
+
Number,
|
|
551
|
+
String
|
|
552
|
+
],
|
|
553
|
+
required: false
|
|
554
|
+
},
|
|
555
|
+
marginBlockStart: {
|
|
556
|
+
type: [
|
|
557
|
+
Boolean,
|
|
558
|
+
Number,
|
|
559
|
+
String
|
|
560
|
+
],
|
|
561
|
+
required: false
|
|
562
|
+
},
|
|
563
|
+
marginBlockEnd: {
|
|
564
|
+
type: [
|
|
565
|
+
Boolean,
|
|
566
|
+
Number,
|
|
567
|
+
String
|
|
568
|
+
],
|
|
569
|
+
required: false
|
|
570
|
+
},
|
|
571
|
+
padding: {
|
|
572
|
+
type: [
|
|
573
|
+
Boolean,
|
|
574
|
+
Number,
|
|
575
|
+
String
|
|
576
|
+
],
|
|
577
|
+
required: false
|
|
578
|
+
},
|
|
579
|
+
paddingTop: {
|
|
580
|
+
type: [
|
|
581
|
+
Boolean,
|
|
582
|
+
Number,
|
|
583
|
+
String
|
|
584
|
+
],
|
|
585
|
+
required: false
|
|
586
|
+
},
|
|
587
|
+
paddingLeft: {
|
|
588
|
+
type: [
|
|
589
|
+
Boolean,
|
|
590
|
+
Number,
|
|
591
|
+
String
|
|
592
|
+
],
|
|
593
|
+
required: false
|
|
594
|
+
},
|
|
595
|
+
paddingBottom: {
|
|
596
|
+
type: [
|
|
597
|
+
Boolean,
|
|
598
|
+
Number,
|
|
599
|
+
String
|
|
600
|
+
],
|
|
601
|
+
required: false
|
|
602
|
+
},
|
|
603
|
+
paddingRight: {
|
|
604
|
+
type: [
|
|
605
|
+
Boolean,
|
|
606
|
+
Number,
|
|
607
|
+
String
|
|
608
|
+
],
|
|
609
|
+
required: false
|
|
610
|
+
},
|
|
611
|
+
paddingBlock: {
|
|
612
|
+
type: [
|
|
613
|
+
Boolean,
|
|
614
|
+
Number,
|
|
615
|
+
String
|
|
616
|
+
],
|
|
617
|
+
required: false
|
|
618
|
+
},
|
|
619
|
+
paddingInline: {
|
|
620
|
+
type: [
|
|
621
|
+
Boolean,
|
|
622
|
+
Number,
|
|
623
|
+
String
|
|
624
|
+
],
|
|
625
|
+
required: false
|
|
626
|
+
},
|
|
627
|
+
paddingInlineStart: {
|
|
628
|
+
type: [
|
|
629
|
+
Boolean,
|
|
630
|
+
Number,
|
|
631
|
+
String
|
|
632
|
+
],
|
|
633
|
+
required: false
|
|
634
|
+
},
|
|
635
|
+
paddingInlineEnd: {
|
|
636
|
+
type: [
|
|
637
|
+
Boolean,
|
|
638
|
+
Number,
|
|
639
|
+
String
|
|
640
|
+
],
|
|
641
|
+
required: false
|
|
642
|
+
},
|
|
643
|
+
paddingBlockStart: {
|
|
644
|
+
type: [
|
|
645
|
+
Boolean,
|
|
646
|
+
Number,
|
|
647
|
+
String
|
|
648
|
+
],
|
|
649
|
+
required: false
|
|
650
|
+
},
|
|
651
|
+
paddingBlockEnd: {
|
|
652
|
+
type: [
|
|
653
|
+
Boolean,
|
|
654
|
+
Number,
|
|
655
|
+
String
|
|
656
|
+
],
|
|
657
|
+
required: false
|
|
658
|
+
},
|
|
659
|
+
rounded: {
|
|
660
|
+
type: [
|
|
661
|
+
Boolean,
|
|
662
|
+
Number,
|
|
663
|
+
String,
|
|
664
|
+
null
|
|
665
|
+
],
|
|
666
|
+
required: false,
|
|
667
|
+
skipCheck: true
|
|
668
|
+
},
|
|
669
|
+
roundedTopRight: {
|
|
670
|
+
type: [
|
|
671
|
+
Boolean,
|
|
672
|
+
Number,
|
|
673
|
+
String
|
|
674
|
+
],
|
|
675
|
+
required: false
|
|
676
|
+
},
|
|
677
|
+
roundedTopLeft: {
|
|
678
|
+
type: [
|
|
679
|
+
Boolean,
|
|
680
|
+
Number,
|
|
681
|
+
String
|
|
682
|
+
],
|
|
683
|
+
required: false
|
|
684
|
+
},
|
|
685
|
+
roundedBottomLeft: {
|
|
686
|
+
type: [
|
|
687
|
+
Boolean,
|
|
688
|
+
Number,
|
|
689
|
+
String
|
|
690
|
+
],
|
|
691
|
+
required: false
|
|
692
|
+
},
|
|
693
|
+
roundedBottomRight: {
|
|
694
|
+
type: [
|
|
695
|
+
Boolean,
|
|
696
|
+
Number,
|
|
697
|
+
String
|
|
698
|
+
],
|
|
699
|
+
required: false
|
|
700
|
+
},
|
|
701
|
+
roundedStartStart: {
|
|
702
|
+
type: [
|
|
703
|
+
Boolean,
|
|
704
|
+
Number,
|
|
705
|
+
String
|
|
706
|
+
],
|
|
707
|
+
required: false
|
|
708
|
+
},
|
|
709
|
+
roundedStartEnd: {
|
|
710
|
+
type: [
|
|
711
|
+
Boolean,
|
|
712
|
+
Number,
|
|
713
|
+
String
|
|
714
|
+
],
|
|
715
|
+
required: false
|
|
716
|
+
},
|
|
717
|
+
roundedEndStart: {
|
|
718
|
+
type: [
|
|
719
|
+
Boolean,
|
|
720
|
+
Number,
|
|
721
|
+
String
|
|
722
|
+
],
|
|
723
|
+
required: false
|
|
724
|
+
},
|
|
725
|
+
roundedEndEnd: {
|
|
726
|
+
type: [
|
|
727
|
+
Boolean,
|
|
728
|
+
Number,
|
|
729
|
+
String
|
|
730
|
+
],
|
|
731
|
+
required: false
|
|
732
|
+
},
|
|
733
|
+
elevation: {
|
|
734
|
+
type: [Number, String],
|
|
735
|
+
required: false
|
|
736
|
+
},
|
|
737
|
+
bgColor: {
|
|
738
|
+
type: [
|
|
739
|
+
String,
|
|
740
|
+
Object,
|
|
741
|
+
Boolean,
|
|
742
|
+
null
|
|
743
|
+
],
|
|
744
|
+
required: false,
|
|
745
|
+
skipCheck: true
|
|
746
|
+
},
|
|
747
|
+
fontSize: {
|
|
748
|
+
type: null,
|
|
749
|
+
required: false
|
|
750
|
+
},
|
|
751
|
+
fontWeight: {
|
|
752
|
+
type: null,
|
|
753
|
+
required: false
|
|
754
|
+
}
|
|
386
755
|
});
|
|
387
|
-
const emit = defineEmits([
|
|
756
|
+
const emit = defineEmits([
|
|
757
|
+
"point-click",
|
|
758
|
+
"legend-click",
|
|
759
|
+
"series-toggle"
|
|
760
|
+
]);
|
|
388
761
|
defineSlots();
|
|
389
762
|
const { t } = useLocale();
|
|
390
763
|
const { dimensionStyles } = useDimension(props);
|
|
@@ -395,6 +768,10 @@ const { paddingClasses, paddingStyles } = usePadding(props);
|
|
|
395
768
|
const { roundedClasses, roundedStyles } = useRounded(props);
|
|
396
769
|
const { headerTypographyStyles } = useChartHeaderTypography(props);
|
|
397
770
|
const chartAnimationStyle = useChartAnimationStyle(props);
|
|
771
|
+
/*********************************************************
|
|
772
|
+
* Static SVG coordinate space
|
|
773
|
+
* Component always paints into 600 × 400; CSS scales it.
|
|
774
|
+
********************************************************/
|
|
398
775
|
const { resizeRef: svgRef, width: svgWidth, height: svgHeight } = useChartSize(CHART_SIZE_FALLBACK.pictorial);
|
|
399
776
|
const { onKeydown: onChartKeydown } = useChartRoving(svgRef);
|
|
400
777
|
const ICON_GAP = 2;
|
|
@@ -404,390 +781,435 @@ const AXIS_PADDING = 4;
|
|
|
404
781
|
const SERIES_GAP = 4;
|
|
405
782
|
const MAX_SLOTS = 8;
|
|
406
783
|
const MIN_ICON_SIZE = 24;
|
|
784
|
+
/*********************************************************
|
|
785
|
+
* Default colour palette — mirrors useChart's DEFAULT_PALETTE
|
|
786
|
+
********************************************************/
|
|
407
787
|
const DEFAULT_PALETTE = [
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
788
|
+
"primary",
|
|
789
|
+
"success",
|
|
790
|
+
"warning",
|
|
791
|
+
"danger",
|
|
792
|
+
"info",
|
|
793
|
+
"secondary",
|
|
794
|
+
"ghost",
|
|
795
|
+
"neutral"
|
|
416
796
|
];
|
|
417
797
|
const resolveColor = (raw) => {
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
798
|
+
if (!raw) return "currentColor";
|
|
799
|
+
if (/^(#|rgb|hsl|var|currentColor|transparent|linear-gradient|radial-gradient|conic-gradient)/i.test(raw)) {
|
|
800
|
+
return raw;
|
|
801
|
+
}
|
|
802
|
+
if (isIntent(raw)) {
|
|
803
|
+
return intentBgExpr(raw, "default");
|
|
804
|
+
}
|
|
805
|
+
return "currentColor";
|
|
426
806
|
};
|
|
427
807
|
const colorForSeries = (seriesIndex) => {
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
808
|
+
if (props.iconColor) return resolveColor(props.iconColor);
|
|
809
|
+
const s = props.series?.[seriesIndex];
|
|
810
|
+
if (s?.color) return resolveColor(s.color);
|
|
811
|
+
const scheme = props.colorScheme?.length ? props.colorScheme : DEFAULT_PALETTE;
|
|
812
|
+
return resolveColor(scheme[seriesIndex % scheme.length]);
|
|
433
813
|
};
|
|
434
|
-
|
|
814
|
+
/*********************************************************
|
|
815
|
+
* Legend hidden-series set
|
|
816
|
+
********************************************************/
|
|
817
|
+
const hiddenSeries = ref(new Set());
|
|
435
818
|
const categoryLabel = (dataIndex) => {
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
819
|
+
const cat = props.categories?.[dataIndex];
|
|
820
|
+
if (cat != null) return String(cat);
|
|
821
|
+
return `Category ${dataIndex + 1}`;
|
|
439
822
|
};
|
|
440
823
|
const formatValue = (v) => {
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
824
|
+
if (props.yAxisFormat) return props.yAxisFormat(v);
|
|
825
|
+
if (props.xAxisFormat) return String(props.xAxisFormat(v));
|
|
826
|
+
return String(v);
|
|
444
827
|
};
|
|
828
|
+
/*********************************************************
|
|
829
|
+
* Geometry helpers
|
|
830
|
+
********************************************************/
|
|
445
831
|
const maxValue = computed(() => {
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
832
|
+
if (!props.series?.length) return 0;
|
|
833
|
+
let max = 0;
|
|
834
|
+
for (const s of props.series) {
|
|
835
|
+
for (const d of s.data) {
|
|
836
|
+
const v = typeof d === "number" ? d : d.y;
|
|
837
|
+
if (Number.isFinite(v) && v > max) max = v;
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
return max;
|
|
455
841
|
});
|
|
456
842
|
const rawSlotsPerColumn = computed(() => {
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
843
|
+
const m = maxValue.value;
|
|
844
|
+
if (m <= 0) return 1;
|
|
845
|
+
return Math.ceil(m / Math.max(1, props.iconsPerUnit));
|
|
460
846
|
});
|
|
461
|
-
const slotsPerColumn = computed(
|
|
462
|
-
() => Math.min(rawSlotsPerColumn.value, MAX_SLOTS)
|
|
463
|
-
);
|
|
847
|
+
const slotsPerColumn = computed(() => Math.min(rawSlotsPerColumn.value, MAX_SLOTS));
|
|
464
848
|
const effectiveIconsPerUnit = computed(() => {
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
849
|
+
const raw = rawSlotsPerColumn.value;
|
|
850
|
+
if (raw <= MAX_SLOTS) return Math.max(1, props.iconsPerUnit);
|
|
851
|
+
return maxValue.value / MAX_SLOTS;
|
|
468
852
|
});
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
853
|
+
/*********************************************************
|
|
854
|
+
* iconsPerUnit — plafond de rendu, desormais annonce (#426)
|
|
855
|
+
*
|
|
856
|
+
* @description
|
|
857
|
+
* ⛔ `iconsPerUnit` n est honoree que tant que la colonne tient en
|
|
858
|
+
* `MAX_SLOTS` icones. Au-dela, le composant RECALCULE son propre pas
|
|
859
|
+
* (`maxValue / MAX_SLOTS`) pour garder la colonne lisible, et la valeur
|
|
860
|
+
* demandee est ignoree — silencieusement jusqu ici.
|
|
861
|
+
*
|
|
862
|
+
* @description
|
|
863
|
+
* Ce n est pas un defaut : dessiner des centaines d icones par colonne
|
|
864
|
+
* n aurait aucun sens. Mais un plafond qui ne se declare pas ressemble a
|
|
865
|
+
* une prop cassee vue du consommateur. Il s annonce donc, une fois, en
|
|
866
|
+
* dev — meme traitement que les props inertes de cette famille.
|
|
867
|
+
********************************************************/
|
|
868
|
+
useUnsupportedProp("OrigamChartPictorial", "iconsPerUnit", `the column is capped at ${MAX_SLOTS} icons: past that the component recomputes its own unit (maxValue / ${MAX_SLOTS}) to keep the column readable, and the requested value is overridden.`, () => rawSlotsPerColumn.value > MAX_SLOTS);
|
|
475
869
|
const categoryCount = computed(() => {
|
|
476
|
-
|
|
477
|
-
|
|
870
|
+
if (!props.series?.length) return 0;
|
|
871
|
+
return Math.max(...props.series.map((s) => s.data?.length ?? 0));
|
|
478
872
|
});
|
|
479
873
|
const seriesCount = computed(() => props.series?.length ?? 0);
|
|
874
|
+
/*********************************************************
|
|
875
|
+
* Plot dimensions — derived from svgWidth / svgHeight
|
|
876
|
+
* minus axis / label reserves.
|
|
877
|
+
********************************************************/
|
|
480
878
|
const axisH = computed(() => props.showAxis ? AXIS_LABEL_HEIGHT + AXIS_PADDING : 0);
|
|
481
879
|
const valueLabelH = computed(() => props.showLabel ? VALUE_LABEL_HEIGHT : 0);
|
|
482
880
|
const plotHeight = computed(() => {
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
881
|
+
if (props.direction === DIRECTION.HORIZONTAL) {
|
|
882
|
+
return svgHeight.value - axisH.value;
|
|
883
|
+
}
|
|
884
|
+
return svgHeight.value - axisH.value - valueLabelH.value;
|
|
487
885
|
});
|
|
488
886
|
const plotWidth = computed(() => {
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
887
|
+
if (props.direction === DIRECTION.HORIZONTAL) {
|
|
888
|
+
return svgWidth.value - axisH.value - valueLabelH.value;
|
|
889
|
+
}
|
|
890
|
+
return svgWidth.value;
|
|
493
891
|
});
|
|
494
892
|
const PLOT_Y = computed(() => props.showLabel ? VALUE_LABEL_HEIGHT : 0);
|
|
495
893
|
const PLOT_X = computed(() => props.direction === DIRECTION.HORIZONTAL && props.showAxis ? AXIS_LABEL_HEIGHT + AXIS_PADDING : 0);
|
|
496
894
|
const columnWidth = computed(() => {
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
895
|
+
const totalCols = categoryCount.value * seriesCount.value;
|
|
896
|
+
if (totalCols <= 0) return 0;
|
|
897
|
+
const totalGaps = (totalCols - 1) * SERIES_GAP;
|
|
898
|
+
if (props.direction === DIRECTION.VERTICAL) {
|
|
899
|
+
return Math.max(4, (plotWidth.value - totalGaps) / totalCols);
|
|
900
|
+
}
|
|
901
|
+
const totalGapsH = (categoryCount.value - 1) * SERIES_GAP;
|
|
902
|
+
return Math.max(4, (plotHeight.value - totalGapsH) / Math.max(1, categoryCount.value));
|
|
505
903
|
});
|
|
506
904
|
const iconSize = computed(() => {
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
905
|
+
const s = slotsPerColumn.value;
|
|
906
|
+
if (s <= 0) return 0;
|
|
907
|
+
if (props.direction === DIRECTION.VERTICAL) {
|
|
908
|
+
const slotH = plotHeight.value / s - ICON_GAP;
|
|
909
|
+
const colBound = columnWidth.value - ICON_GAP;
|
|
910
|
+
return Math.max(MIN_ICON_SIZE, Math.min(slotH, colBound));
|
|
911
|
+
}
|
|
912
|
+
const slotW = plotWidth.value / s - ICON_GAP;
|
|
913
|
+
const colBound = columnWidth.value - ICON_GAP;
|
|
914
|
+
return Math.max(MIN_ICON_SIZE, Math.min(slotW, colBound));
|
|
517
915
|
});
|
|
916
|
+
/*********************************************************
|
|
917
|
+
* Column descriptors
|
|
918
|
+
********************************************************/
|
|
518
919
|
const columns = computed(() => {
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
920
|
+
if (!props.series?.length || categoryCount.value === 0) return [];
|
|
921
|
+
const result = [];
|
|
922
|
+
const colW = columnWidth.value;
|
|
923
|
+
const iSize = iconSize.value;
|
|
924
|
+
for (let catIdx = 0; catIdx < categoryCount.value; catIdx++) {
|
|
925
|
+
for (let serIdx = 0; serIdx < seriesCount.value; serIdx++) {
|
|
926
|
+
const s = props.series[serIdx];
|
|
927
|
+
if (!s) continue;
|
|
928
|
+
const raw = s.data[catIdx];
|
|
929
|
+
const value = raw == null ? 0 : typeof raw === "number" ? raw : raw.y;
|
|
930
|
+
const safeValue = Number.isFinite(value) && value >= 0 ? value : 0;
|
|
931
|
+
const filledSlots = Math.round(safeValue / effectiveIconsPerUnit.value);
|
|
932
|
+
const colIdx = catIdx * seriesCount.value + serIdx;
|
|
933
|
+
const isHidden = hiddenSeries.value.has(s.name);
|
|
934
|
+
let x;
|
|
935
|
+
let y;
|
|
936
|
+
if (props.direction === DIRECTION.VERTICAL) {
|
|
937
|
+
x = PLOT_X.value + colIdx * (colW + SERIES_GAP);
|
|
938
|
+
y = PLOT_Y.value;
|
|
939
|
+
} else {
|
|
940
|
+
x = PLOT_X.value;
|
|
941
|
+
y = PLOT_Y.value + catIdx * (colW + SERIES_GAP);
|
|
942
|
+
}
|
|
943
|
+
result.push({
|
|
944
|
+
seriesIndex: serIdx,
|
|
945
|
+
dataIndex: catIdx,
|
|
946
|
+
category: categoryLabel(catIdx),
|
|
947
|
+
value: safeValue,
|
|
948
|
+
formatted: formatValue(safeValue),
|
|
949
|
+
totalSlots: slotsPerColumn.value,
|
|
950
|
+
filledSlots: Math.min(filledSlots, slotsPerColumn.value),
|
|
951
|
+
color: colorForSeries(serIdx),
|
|
952
|
+
x,
|
|
953
|
+
y,
|
|
954
|
+
iconSize: iSize,
|
|
955
|
+
visible: !isHidden
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
return result;
|
|
559
960
|
});
|
|
560
961
|
const visibleColumns = computed(() => columns.value.filter((c) => c.visible));
|
|
962
|
+
/*********************************************************
|
|
963
|
+
* Fill mode geometry
|
|
964
|
+
* One large icon per category, clip-masked from bottom up
|
|
965
|
+
* to show the fill ratio (like a thermometer / glass fill).
|
|
966
|
+
********************************************************/
|
|
561
967
|
const FILL_LABEL_HEIGHT = 20;
|
|
562
968
|
const FILL_GAP = 12;
|
|
563
969
|
const FILL_AXIS_HEIGHT = computed(() => props.showAxis ? AXIS_LABEL_HEIGHT + AXIS_PADDING : 0);
|
|
564
970
|
const FILL_LABEL_RESERVE = computed(() => props.showLabel ? FILL_LABEL_HEIGHT : 0);
|
|
565
|
-
const fillPlotHeight = computed(
|
|
566
|
-
() => svgHeight.value - FILL_AXIS_HEIGHT.value - FILL_LABEL_RESERVE.value
|
|
567
|
-
);
|
|
971
|
+
const fillPlotHeight = computed(() => svgHeight.value - FILL_AXIS_HEIGHT.value - FILL_LABEL_RESERVE.value);
|
|
568
972
|
const fillCategoryCount = computed(() => {
|
|
569
|
-
|
|
570
|
-
|
|
973
|
+
if (!props.series?.length) return 0;
|
|
974
|
+
return Math.max(...props.series.map((s) => s.data?.length ?? 0));
|
|
571
975
|
});
|
|
572
|
-
const fillTotalCols = computed(
|
|
573
|
-
|
|
574
|
-
)
|
|
976
|
+
const fillTotalCols = computed(() => fillCategoryCount.value * (props.series?.length ?? 0));
|
|
977
|
+
/**
|
|
978
|
+
* fillIconWidth — horizontal space per column (derived from svgWidth).
|
|
979
|
+
* fillIconHeight — vertical space each icon occupies (= full plot height).
|
|
980
|
+
* Keeping them separate allows portrait icons to fill the column vertically
|
|
981
|
+
* while the column width remains constrained by the number of categories.
|
|
982
|
+
*/
|
|
575
983
|
const fillIconWidth = computed(() => {
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
984
|
+
const totalCols = fillTotalCols.value;
|
|
985
|
+
if (totalCols <= 0) return 0;
|
|
986
|
+
const totalGaps = (totalCols - 1) * FILL_GAP;
|
|
987
|
+
return Math.max(24, (svgWidth.value - totalGaps) / totalCols);
|
|
580
988
|
});
|
|
581
|
-
const fillIconHeight = computed(
|
|
582
|
-
() => Math.max(24, fillPlotHeight.value)
|
|
583
|
-
);
|
|
989
|
+
const fillIconHeight = computed(() => Math.max(24, fillPlotHeight.value));
|
|
584
990
|
const fillModeColumns = computed(() => {
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
991
|
+
if (props.mode !== CHART_PICTORIAL_MODE.FILL) return [];
|
|
992
|
+
if (!props.series?.length || fillCategoryCount.value === 0) return [];
|
|
993
|
+
const result = [];
|
|
994
|
+
const iWidth = fillIconWidth.value;
|
|
995
|
+
const seriesLen = props.series.length;
|
|
996
|
+
for (let catIdx = 0; catIdx < fillCategoryCount.value; catIdx++) {
|
|
997
|
+
for (let serIdx = 0; serIdx < seriesLen; serIdx++) {
|
|
998
|
+
const s = props.series[serIdx];
|
|
999
|
+
if (!s) continue;
|
|
1000
|
+
const isHidden = hiddenSeries.value.has(s.name);
|
|
1001
|
+
const raw = s.data[catIdx];
|
|
1002
|
+
const value = raw == null ? 0 : typeof raw === "number" ? raw : raw.y;
|
|
1003
|
+
const safeValue = Number.isFinite(value) && value >= 0 ? value : 0;
|
|
1004
|
+
const colIdx = catIdx * seriesLen + serIdx;
|
|
1005
|
+
result.push({
|
|
1006
|
+
seriesIndex: serIdx,
|
|
1007
|
+
dataIndex: catIdx,
|
|
1008
|
+
category: categoryLabel(catIdx),
|
|
1009
|
+
value: safeValue,
|
|
1010
|
+
formatted: formatValue(safeValue),
|
|
1011
|
+
totalSlots: 1,
|
|
1012
|
+
filledSlots: 1,
|
|
1013
|
+
color: colorForSeries(serIdx),
|
|
1014
|
+
x: colIdx * (iWidth + FILL_GAP),
|
|
1015
|
+
y: PLOT_Y.value,
|
|
1016
|
+
iconSize: iWidth,
|
|
1017
|
+
visible: !isHidden
|
|
1018
|
+
});
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
return result.filter((c) => c.visible);
|
|
616
1022
|
});
|
|
617
1023
|
const fillColX = (col) => col.x;
|
|
618
1024
|
const fillColY = (col) => col.y;
|
|
619
1025
|
const fillRatio = (col) => {
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
1026
|
+
const max = maxValue.value;
|
|
1027
|
+
if (max <= 0) return 0;
|
|
1028
|
+
return Math.min(1, Math.max(0, col.value / max));
|
|
623
1029
|
};
|
|
624
1030
|
const fillClipY = (col) => {
|
|
625
|
-
|
|
626
|
-
|
|
1031
|
+
const ratio = fillRatio(col);
|
|
1032
|
+
return fillIconHeight.value * (1 - ratio);
|
|
627
1033
|
};
|
|
628
1034
|
const fillClipHeight = (col) => {
|
|
629
|
-
|
|
630
|
-
|
|
1035
|
+
const ratio = fillRatio(col);
|
|
1036
|
+
return fillIconHeight.value * ratio;
|
|
631
1037
|
};
|
|
632
1038
|
const fillLabelY = (_col) => -FILL_LABEL_HEIGHT / 2;
|
|
633
1039
|
const fillValueLabel = (col) => {
|
|
634
|
-
|
|
635
|
-
|
|
1040
|
+
const pct = Math.round(fillRatio(col) * 100);
|
|
1041
|
+
return `${col.formatted} (${pct}%)`;
|
|
636
1042
|
};
|
|
637
1043
|
const fillColumnAriaLabel = (col) => {
|
|
638
|
-
|
|
639
|
-
|
|
1044
|
+
const pct = Math.round(fillRatio(col) * 100);
|
|
1045
|
+
return t("origam.chart.pictorial.fill_column_aria_label", col.category, col.formatted, pct);
|
|
640
1046
|
};
|
|
1047
|
+
/*********************************************************
|
|
1048
|
+
* Icon position helpers
|
|
1049
|
+
* Vertical: icons stacked bottom-to-top (slot 0 = bottom)
|
|
1050
|
+
* Horizontal: icons stacked left-to-right (slot 0 = left)
|
|
1051
|
+
********************************************************/
|
|
641
1052
|
const iconX = (col, slotIdx) => {
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
1053
|
+
if (props.direction === DIRECTION.HORIZONTAL) {
|
|
1054
|
+
return slotIdx * (col.iconSize + ICON_GAP);
|
|
1055
|
+
}
|
|
1056
|
+
const colW = columnWidth.value;
|
|
1057
|
+
return (colW - col.iconSize) / 2;
|
|
647
1058
|
};
|
|
648
1059
|
const iconY = (col, slotIdx) => {
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
1060
|
+
if (props.direction === DIRECTION.HORIZONTAL) {
|
|
1061
|
+
const colW = columnWidth.value;
|
|
1062
|
+
return (colW - col.iconSize) / 2;
|
|
1063
|
+
}
|
|
1064
|
+
const totalH = slotsPerColumn.value * (col.iconSize + ICON_GAP) - ICON_GAP;
|
|
1065
|
+
const fromBottom = slotsPerColumn.value - 1 - slotIdx;
|
|
1066
|
+
return totalH - fromBottom * (col.iconSize + ICON_GAP) - col.iconSize;
|
|
656
1067
|
};
|
|
1068
|
+
/*********************************************************
|
|
1069
|
+
* Label position helpers
|
|
1070
|
+
********************************************************/
|
|
657
1071
|
const labelX = (col) => {
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
1072
|
+
if (props.direction === DIRECTION.HORIZONTAL) {
|
|
1073
|
+
const usedW = slotsPerColumn.value * (col.iconSize + ICON_GAP);
|
|
1074
|
+
return usedW + VALUE_LABEL_HEIGHT / 2;
|
|
1075
|
+
}
|
|
1076
|
+
return columnWidth.value / 2;
|
|
663
1077
|
};
|
|
664
1078
|
const labelY = (_col) => {
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
1079
|
+
if (props.direction === DIRECTION.HORIZONTAL) {
|
|
1080
|
+
return columnWidth.value / 2;
|
|
1081
|
+
}
|
|
1082
|
+
return -VALUE_LABEL_HEIGHT / 2;
|
|
669
1083
|
};
|
|
670
1084
|
const axisLabel = (col) => {
|
|
671
|
-
|
|
672
|
-
|
|
1085
|
+
if (props.xAxisFormat) return String(props.xAxisFormat(col.category));
|
|
1086
|
+
return col.category;
|
|
673
1087
|
};
|
|
1088
|
+
/*********************************************************
|
|
1089
|
+
* Legend items — one per series
|
|
1090
|
+
********************************************************/
|
|
674
1091
|
const legendItems = computed(() => {
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
1092
|
+
if (!props.series?.length) return [];
|
|
1093
|
+
return props.series.map((s, i) => ({
|
|
1094
|
+
series: {
|
|
1095
|
+
...s,
|
|
1096
|
+
visible: !hiddenSeries.value.has(s.name)
|
|
1097
|
+
},
|
|
1098
|
+
index: i,
|
|
1099
|
+
color: colorForSeries(i),
|
|
1100
|
+
visible: !hiddenSeries.value.has(s.name)
|
|
1101
|
+
}));
|
|
1102
|
+
});
|
|
1103
|
+
/*********************************************************
|
|
1104
|
+
* Hover / tooltip state
|
|
1105
|
+
********************************************************/
|
|
1106
|
+
const mousePos = ref({
|
|
1107
|
+
x: 0,
|
|
1108
|
+
y: 0
|
|
685
1109
|
});
|
|
686
|
-
const mousePos = ref({ x: 0, y: 0 });
|
|
687
1110
|
const hoveredColKey = ref(null);
|
|
688
|
-
const activeColumns = computed(
|
|
689
|
-
() => props.mode === CHART_PICTORIAL_MODE.FILL ? fillModeColumns.value : visibleColumns.value
|
|
690
|
-
);
|
|
1111
|
+
const activeColumns = computed(() => props.mode === CHART_PICTORIAL_MODE.FILL ? fillModeColumns.value : visibleColumns.value);
|
|
691
1112
|
const hoveredColumn = computed(() => {
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
(c) => `${c.seriesIndex}-${c.dataIndex}` === hoveredColKey.value
|
|
695
|
-
) ?? null;
|
|
1113
|
+
if (!hoveredColKey.value) return null;
|
|
1114
|
+
return activeColumns.value.find((c) => `${c.seriesIndex}-${c.dataIndex}` === hoveredColKey.value) ?? null;
|
|
696
1115
|
});
|
|
697
1116
|
const hoveredPoint = computed(() => {
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
1117
|
+
const col = hoveredColumn.value;
|
|
1118
|
+
if (!col || !props.series?.[col.seriesIndex]) return null;
|
|
1119
|
+
return {
|
|
1120
|
+
seriesIndex: col.seriesIndex,
|
|
1121
|
+
seriesName: props.series[col.seriesIndex].name,
|
|
1122
|
+
dataIndex: col.dataIndex,
|
|
1123
|
+
x: col.category,
|
|
1124
|
+
y: col.value,
|
|
1125
|
+
color: col.color
|
|
1126
|
+
};
|
|
708
1127
|
});
|
|
709
1128
|
const hoveredSeries = computed(() => {
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
1129
|
+
const col = hoveredColumn.value;
|
|
1130
|
+
if (!col) return null;
|
|
1131
|
+
return props.series?.[col.seriesIndex] ?? null;
|
|
713
1132
|
});
|
|
714
|
-
const hoveredCategory = computed(
|
|
715
|
-
() => hoveredColumn.value?.category ?? ""
|
|
716
|
-
);
|
|
1133
|
+
const hoveredCategory = computed(() => hoveredColumn.value?.category ?? "");
|
|
717
1134
|
const showEmpty = computed(() => {
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
1135
|
+
if (!props.series?.length) return true;
|
|
1136
|
+
const hasData = props.series.some((s) => s.data?.length > 0);
|
|
1137
|
+
if (!hasData) return true;
|
|
1138
|
+
return activeColumns.value.length === 0;
|
|
722
1139
|
});
|
|
1140
|
+
/*********************************************************
|
|
1141
|
+
* Root classes / styles
|
|
1142
|
+
********************************************************/
|
|
723
1143
|
const rootClasses = computed(() => [
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
1144
|
+
{
|
|
1145
|
+
[`origam-chart-pictorial--${props.direction}`]: true,
|
|
1146
|
+
[`origam-chart-pictorial--${props.mode}`]: true,
|
|
1147
|
+
[`origam-chart-pictorial--legend-${props.legendPosition}`]: true,
|
|
1148
|
+
"origam-chart-pictorial--no-animation": !props.animated
|
|
1149
|
+
},
|
|
1150
|
+
backgroundColorClasses.value,
|
|
1151
|
+
elevationClasses.value,
|
|
1152
|
+
marginClasses.value,
|
|
1153
|
+
paddingClasses.value,
|
|
1154
|
+
roundedClasses.value,
|
|
1155
|
+
props.class
|
|
736
1156
|
]);
|
|
737
1157
|
const rootStyles = computed(() => {
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
1158
|
+
const out = {};
|
|
1159
|
+
if (props.aspectRatio) {
|
|
1160
|
+
out.aspectRatio = props.aspectRatio;
|
|
1161
|
+
}
|
|
1162
|
+
Object.assign(out, chartAnimationStyle.value);
|
|
1163
|
+
return [out, props.style];
|
|
744
1164
|
});
|
|
745
|
-
const bodyClasses = computed(() => ({
|
|
746
|
-
|
|
747
|
-
}));
|
|
748
|
-
const svgClasses = computed(() => ({
|
|
749
|
-
"origam-chart__svg--animated": props.animated
|
|
750
|
-
}));
|
|
1165
|
+
const bodyClasses = computed(() => ({ "origam-chart-pictorial__body--with-side-legend": props.showLegend && (props.legendPosition === "left" || props.legendPosition === "right") }));
|
|
1166
|
+
const svgClasses = computed(() => ({ "origam-chart__svg--animated": props.animated }));
|
|
751
1167
|
const hasTitleBlock = computed(() => Boolean(props.title || props.subtitle));
|
|
1168
|
+
/*********************************************************
|
|
1169
|
+
* ARIA
|
|
1170
|
+
********************************************************/
|
|
752
1171
|
const ariaLabel = computed(() => props.title ?? t("origam.chart.pictorial.aria_label"));
|
|
753
1172
|
const svgAriaLabel = computed(() => props.title ?? t("origam.chart.pictorial.aria_label"));
|
|
754
1173
|
const svgTitle = computed(() => props.title ?? t("origam.chart.pictorial.aria_label"));
|
|
755
1174
|
const svgDesc = computed(() => {
|
|
756
|
-
|
|
757
|
-
|
|
1175
|
+
const n = visibleColumns.value.length;
|
|
1176
|
+
return t("origam.chart.pictorial.desc", n);
|
|
758
1177
|
});
|
|
759
1178
|
const columnAriaLabel = (col) => t("origam.chart.pictorial.column_aria_label", col.category, col.formatted, col.filledSlots, col.totalSlots);
|
|
1179
|
+
/*********************************************************
|
|
1180
|
+
* Interaction
|
|
1181
|
+
********************************************************/
|
|
760
1182
|
const onColumnEnter = (col) => {
|
|
761
|
-
|
|
1183
|
+
hoveredColKey.value = `${col.seriesIndex}-${col.dataIndex}`;
|
|
762
1184
|
};
|
|
763
1185
|
const onColumnLeave = () => {
|
|
764
|
-
|
|
1186
|
+
hoveredColKey.value = null;
|
|
765
1187
|
};
|
|
766
1188
|
const onSvgMouseMove = (event) => {
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
1189
|
+
const target = svgRef.value;
|
|
1190
|
+
if (!target) return;
|
|
1191
|
+
const rect = target.getBoundingClientRect();
|
|
1192
|
+
mousePos.value = {
|
|
1193
|
+
x: event.clientX - rect.left,
|
|
1194
|
+
y: event.clientY - rect.top
|
|
1195
|
+
};
|
|
774
1196
|
};
|
|
775
1197
|
const onSvgMouseLeave = () => {
|
|
776
|
-
|
|
1198
|
+
onColumnLeave();
|
|
777
1199
|
};
|
|
778
1200
|
const onColumnActivate = (col, event) => {
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
1201
|
+
hoveredColKey.value = `${col.seriesIndex}-${col.dataIndex}`;
|
|
1202
|
+
if (hoveredPoint.value) {
|
|
1203
|
+
emit("point-click", hoveredPoint.value, event);
|
|
1204
|
+
}
|
|
783
1205
|
};
|
|
784
1206
|
const onLegendClick = (series, index) => {
|
|
785
|
-
|
|
1207
|
+
emit("legend-click", series, index);
|
|
786
1208
|
};
|
|
787
1209
|
const onSeriesToggle = (series, nextVisible) => {
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
1210
|
+
if (nextVisible) hiddenSeries.value.delete(series.name);
|
|
1211
|
+
else hiddenSeries.value.add(series.name);
|
|
1212
|
+
emit("series-toggle", series, nextVisible);
|
|
791
1213
|
};
|
|
792
1214
|
</script>
|
|
793
1215
|
|