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.
Files changed (228) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/src/assets/locales/en.json +1 -1
  3. package/dist/src/assets/locales/fr.json +2 -2
  4. package/dist/src/components/Alert/OrigamAlert.vue +739 -165
  5. package/dist/src/components/App/OrigamApp.vue +95 -19
  6. package/dist/src/components/App/OrigamAppBar.vue +751 -158
  7. package/dist/src/components/Audio/OrigamAudio.vue +1288 -346
  8. package/dist/src/components/Audio/OrigamAudioWaveform.vue +63 -7
  9. package/dist/src/components/Avatar/OrigamAvatar.vue +678 -126
  10. package/dist/src/components/Avatar/OrigamAvatarGroup.vue +700 -153
  11. package/dist/src/components/Badge/OrigamBadge.vue +548 -135
  12. package/dist/src/components/Blockquote/OrigamBlockquote.vue +698 -140
  13. package/dist/src/components/BottomNav/OrigamBottomNav.vue +864 -156
  14. package/dist/src/components/Bracket/OrigamBracket.vue +1013 -380
  15. package/dist/src/components/Bracket/OrigamBracketCompetitor.vue +674 -154
  16. package/dist/src/components/Bracket/OrigamBracketMatch.vue +663 -163
  17. package/dist/src/components/Bracket/OrigamBracketRound.vue +116 -34
  18. package/dist/src/components/Breadcrumb/OrigamBreadcrumb.vue +654 -119
  19. package/dist/src/components/Breadcrumb/OrigamBreadcrumbDivider.vue +292 -54
  20. package/dist/src/components/Breadcrumb/OrigamBreadcrumbItem.vue +657 -126
  21. package/dist/src/components/Btn/OrigamBtn.vue +928 -249
  22. package/dist/src/components/Btn/OrigamBtnGroup.vue +658 -141
  23. package/dist/src/components/Btn/OrigamBtnToggle.vue +578 -91
  24. package/dist/src/components/Calendar/OrigamCalendar.vue +1142 -484
  25. package/dist/src/components/Card/OrigamCard.vue +938 -194
  26. package/dist/src/components/Card/OrigamCardHeader.vue +593 -104
  27. package/dist/src/components/Card/OrigamCardText.vue +536 -84
  28. package/dist/src/components/Carousel/OrigamCarousel.vue +778 -202
  29. package/dist/src/components/Carousel/OrigamCarouselItem.vue +660 -109
  30. package/dist/src/components/Chart/OrigamChart.vue +942 -452
  31. package/dist/src/components/Chart/OrigamChartAxis.vue +111 -19
  32. package/dist/src/components/Chart/OrigamChartBoxPlot.vue +713 -297
  33. package/dist/src/components/Chart/OrigamChartBullet.vue +701 -286
  34. package/dist/src/components/Chart/OrigamChartCandlestick.vue +663 -243
  35. package/dist/src/components/Chart/OrigamChartCartesian.vue +1055 -487
  36. package/dist/src/components/Chart/OrigamChartGauge.vue +563 -164
  37. package/dist/src/components/Chart/OrigamChartHeatmap.vue +677 -251
  38. package/dist/src/components/Chart/OrigamChartHoneycomb.vue +700 -288
  39. package/dist/src/components/Chart/OrigamChartLegend.vue +108 -16
  40. package/dist/src/components/Chart/OrigamChartMap.vue +723 -299
  41. package/dist/src/components/Chart/OrigamChartPareto.vue +721 -276
  42. package/dist/src/components/Chart/OrigamChartPictorial.vue +777 -355
  43. package/dist/src/components/Chart/OrigamChartPolar.vue +603 -210
  44. package/dist/src/components/Chart/OrigamChartPolarBar.vue +674 -271
  45. package/dist/src/components/Chart/OrigamChartPyramid.vue +685 -250
  46. package/dist/src/components/Chart/OrigamChartRadar.vue +515 -165
  47. package/dist/src/components/Chart/OrigamChartRangeSelector.vue +50 -25
  48. package/dist/src/components/Chart/OrigamChartSankey.vue +913 -467
  49. package/dist/src/components/Chart/OrigamChartSparkline.vue +711 -268
  50. package/dist/src/components/Chart/OrigamChartStreamgraph.vue +810 -368
  51. package/dist/src/components/Chart/OrigamChartSunburst.vue +779 -368
  52. package/dist/src/components/Chart/OrigamChartTooltip.vue +78 -19
  53. package/dist/src/components/Chart/OrigamChartTreemap.vue +750 -288
  54. package/dist/src/components/Chart/OrigamChartVariwide.vue +679 -251
  55. package/dist/src/components/Chart/OrigamChartWordCloud.vue +674 -265
  56. package/dist/src/components/Checkbox/OrigamCheckbox.vue +781 -136
  57. package/dist/src/components/Checkbox/OrigamCheckboxBtn.vue +465 -81
  58. package/dist/src/components/Checkbox/OrigamCheckboxGroup.vue +824 -137
  59. package/dist/src/components/Chip/OrigamChip.vue +867 -202
  60. package/dist/src/components/Chip/OrigamChipGroup.vue +633 -121
  61. package/dist/src/components/ClientOnly/OrigamClientOnly.vue +30 -4
  62. package/dist/src/components/Clipboard/OrigamClipboard.vue +624 -105
  63. package/dist/src/components/Code/OrigamCode.vue +844 -206
  64. package/dist/src/components/CodeGroup/OrigamCodeGroup.vue +494 -83
  65. package/dist/src/components/ColorPicker/OrigamColorPicker.vue +777 -159
  66. package/dist/src/components/ColorPicker/OrigamColorPickerCanvas.vue +295 -181
  67. package/dist/src/components/ColorPicker/OrigamColorPickerEdit.vue +108 -45
  68. package/dist/src/components/ColorPicker/OrigamColorPickerPreview.vue +131 -46
  69. package/dist/src/components/ColorPicker/OrigamColorPickerSwatches.vue +128 -39
  70. package/dist/src/components/ColorPickerField/OrigamColorPickerField.vue +1123 -258
  71. package/dist/src/components/CommandPalette/OrigamCommandPalette.vue +415 -162
  72. package/dist/src/components/ConfirmWrapper/OrigamConfirmWrapper.vue +389 -145
  73. package/dist/src/components/ContextualMenu/OrigamContextualMenu.vue +852 -147
  74. package/dist/src/components/Counter/OrigamCounter.vue +588 -96
  75. package/dist/src/components/DataList/OrigamDataList.vue +619 -113
  76. package/dist/src/components/DataList/OrigamDataText.vue +295 -65
  77. package/dist/src/components/DataList/OrigamDataTitle.vue +295 -65
  78. package/dist/src/components/DataTable/OrigamDataTable.vue +934 -222
  79. package/dist/src/components/DataTable/OrigamDataTableColumnCell.vue +196 -51
  80. package/dist/src/components/DataTable/OrigamDataTableFooter.vue +319 -78
  81. package/dist/src/components/DataTable/OrigamDataTableGroupHeaderRow.vue +124 -44
  82. package/dist/src/components/DataTable/OrigamDataTableHeaderCell.vue +181 -70
  83. package/dist/src/components/DataTable/OrigamDataTableHeaders.vue +155 -46
  84. package/dist/src/components/DataTable/OrigamDataTableHeadersCell.vue +145 -27
  85. package/dist/src/components/DataTable/OrigamDataTableHeadersCellMobile.vue +126 -43
  86. package/dist/src/components/DataTable/OrigamDataTableRow.vue +151 -73
  87. package/dist/src/components/DataTable/OrigamDataTableRows.vue +261 -106
  88. package/dist/src/components/DatePicker/OrigamDatePicker.vue +1048 -261
  89. package/dist/src/components/DatePicker/OrigamDatePickerControls.vue +155 -51
  90. package/dist/src/components/DatePicker/OrigamDatePickerHeader.vue +147 -46
  91. package/dist/src/components/DatePicker/OrigamDatePickerMonth.vue +312 -134
  92. package/dist/src/components/DatePicker/OrigamDatePickerMonths.vue +151 -61
  93. package/dist/src/components/DatePicker/OrigamDatePickerYears.vue +154 -67
  94. package/dist/src/components/DatePickerField/OrigamDatePickerField.vue +1147 -306
  95. package/dist/src/components/DefaultsProvider/OrigamDefaultsProvider.vue +74 -14
  96. package/dist/src/components/Dialog/OrigamDialog.vue +953 -196
  97. package/dist/src/components/Dialog/OrigamDialogConfirmation.vue +886 -148
  98. package/dist/src/components/Divider/OrigamDivider.vue +210 -50
  99. package/dist/src/components/Drawer/OrigamDrawer.vue +909 -207
  100. package/dist/src/components/EmptyState/OrigamEmptyState.vue +146 -35
  101. package/dist/src/components/ExpansionPanel/OrigamExpansionPanel.vue +746 -159
  102. package/dist/src/components/ExpansionPanel/OrigamExpansionPanelContent.vue +591 -95
  103. package/dist/src/components/ExpansionPanel/OrigamExpansionPanelHeader.vue +663 -143
  104. package/dist/src/components/ExpansionPanel/OrigamExpansionPanels.vue +675 -134
  105. package/dist/src/components/Field/OrigamField.vue +1118 -306
  106. package/dist/src/components/FileField/OrigamFileField.vue +1188 -311
  107. package/dist/src/components/FileField/OrigamFileFieldDragNDropItem.vue +155 -36
  108. package/dist/src/components/FileField/OrigamFileFieldListItem.vue +155 -36
  109. package/dist/src/components/Form/OrigamForm.vue +197 -74
  110. package/dist/src/components/Grid/OrigamGrid.vue +707 -147
  111. package/dist/src/components/Grid/OrigamGridItem.vue +110 -37
  112. package/dist/src/components/Grids/OrigamCol.vue +593 -110
  113. package/dist/src/components/Grids/OrigamContainer.vue +461 -80
  114. package/dist/src/components/Grids/OrigamRow.vue +573 -112
  115. package/dist/src/components/Grids/OrigamSpacer.vue +54 -17
  116. package/dist/src/components/Icon/OrigamClassIcon.vue +573 -98
  117. package/dist/src/components/Icon/OrigamComponentIcon.vue +561 -101
  118. package/dist/src/components/Icon/OrigamIcon.vue +561 -98
  119. package/dist/src/components/Icon/OrigamLigatureIcon.vue +558 -98
  120. package/dist/src/components/Icon/OrigamSvgIcon.vue +593 -100
  121. package/dist/src/components/Img/OrigamImg.vue +869 -228
  122. package/dist/src/components/InfiniteScroll/OrigamInfiniteScroll.vue +319 -111
  123. package/dist/src/components/InfiniteScroll/OrigamInfiniteScrollIntersect.vue +80 -17
  124. package/dist/src/components/InlineEdit/OrigamInlineEdit.vue +476 -140
  125. package/dist/src/components/Input/OrigamInput.vue +747 -180
  126. package/dist/src/components/ItemGroup/OrigamItemGroup.vue +112 -36
  127. package/dist/src/components/ItemGroup/OrigamItemGroupItem.vue +80 -29
  128. package/dist/src/components/Kbd/OrigamKbd.vue +450 -75
  129. package/dist/src/components/Label/OrigamLabel.vue +584 -95
  130. package/dist/src/components/Layout/OrigamLayout.vue +563 -94
  131. package/dist/src/components/Lazy/OrigamLazy.vue +131 -34
  132. package/dist/src/components/List/OrigamList.vue +755 -170
  133. package/dist/src/components/List/OrigamListChildren.vue +59 -19
  134. package/dist/src/components/List/OrigamListGroup.vue +631 -134
  135. package/dist/src/components/List/OrigamListGroupActivator.vue +45 -17
  136. package/dist/src/components/List/OrigamListItem.vue +890 -224
  137. package/dist/src/components/List/OrigamListItemWrapper.vue +20 -10
  138. package/dist/src/components/List/OrigamListSubheader.vue +542 -93
  139. package/dist/src/components/Loader/OrigamLoader.vue +110 -25
  140. package/dist/src/components/Main/OrigamMain.vue +565 -96
  141. package/dist/src/components/Masonry/OrigamMasonry.vue +799 -187
  142. package/dist/src/components/Media/OrigamMediaController.vue +465 -182
  143. package/dist/src/components/Media/OrigamMediaScrubber.vue +389 -152
  144. package/dist/src/components/Media/OrigamMediaVolumeControl.vue +174 -44
  145. package/dist/src/components/Menu/OrigamMenu.vue +1079 -255
  146. package/dist/src/components/Messages/OrigamMessages.vue +606 -97
  147. package/dist/src/components/NumberField/OrigamNumberField.vue +1208 -333
  148. package/dist/src/components/NumberFormat/OrigamNumberFormat.vue +177 -57
  149. package/dist/src/components/OtpInputField/OrigamOtpInputField.vue +1016 -272
  150. package/dist/src/components/Overlay/OrigamOverlay.vue +446 -158
  151. package/dist/src/components/Overlay/OrigamOverlayScrim.vue +122 -30
  152. package/dist/src/components/Pagination/OrigamPagination.vue +982 -313
  153. package/dist/src/components/Parallax/OrigamParallax.vue +800 -259
  154. package/dist/src/components/Parallax/OrigamParallaxElement.vue +694 -178
  155. package/dist/src/components/Parallax/OrigamParallaxLayer.vue +132 -47
  156. package/dist/src/components/PasswordField/OrigamPasswordField.vue +1098 -265
  157. package/dist/src/components/Picker/OrigamPicker.vue +655 -108
  158. package/dist/src/components/Picker/OrigamPickerTitle.vue +108 -26
  159. package/dist/src/components/Progress/OrigamProgress.vue +436 -70
  160. package/dist/src/components/Progress/OrigamProgressCircular.vue +399 -82
  161. package/dist/src/components/Progress/OrigamProgressLinear.vue +468 -115
  162. package/dist/src/components/QrCode/OrigamQrCode.vue +642 -126
  163. package/dist/src/components/Radio/OrigamRadio.vue +772 -132
  164. package/dist/src/components/Radio/OrigamRadioBtn.vue +446 -71
  165. package/dist/src/components/Radio/OrigamRadioGroup.vue +808 -135
  166. package/dist/src/components/RatingField/OrigamRatingField.vue +963 -194
  167. package/dist/src/components/RatingField/OrigamRatingFieldItem.vue +657 -106
  168. package/dist/src/components/Responsive/OrigamResponsive.vue +548 -91
  169. package/dist/src/components/Select/OrigamSelect.vue +1639 -567
  170. package/dist/src/components/SelectionControl/OrigamSelectionControl.vue +564 -151
  171. package/dist/src/components/SelectionControl/OrigamSelectionControlGroup.vue +178 -62
  172. package/dist/src/components/Sheet/OrigamSheet.vue +773 -199
  173. package/dist/src/components/Skeleton/OrigamSkeleton.vue +249 -46
  174. package/dist/src/components/Skeleton/OrigamSkeletonGroup.vue +66 -11
  175. package/dist/src/components/Slide/OrigamSlideGroup.vue +772 -257
  176. package/dist/src/components/SliderField/OrigamSliderField.vue +1157 -335
  177. package/dist/src/components/SliderField/OrigamSliderFieldTrack.vue +236 -112
  178. package/dist/src/components/Snackbar/OrigamSnackbar.vue +871 -214
  179. package/dist/src/components/Snackbar/OrigamSnackbarGroup.vue +218 -51
  180. package/dist/src/components/Snackbar/OrigamSnackbarItem.vue +175 -43
  181. package/dist/src/components/Stepper/OrigamStepper.vue +618 -126
  182. package/dist/src/components/Stepper/OrigamStepperItem.vue +98 -37
  183. package/dist/src/components/Switch/OrigamSwitch.vue +879 -156
  184. package/dist/src/components/Switch/OrigamSwitchTrack.vue +431 -78
  185. package/dist/src/components/SystemBar/OrigamSystemBar.vue +517 -87
  186. package/dist/src/components/Table/OrigamTable.vue +585 -124
  187. package/dist/src/components/Tabs/OrigamTab.vue +239 -73
  188. package/dist/src/components/Tabs/OrigamTabPanel.vue +125 -39
  189. package/dist/src/components/Tabs/OrigamTabPanels.vue +148 -57
  190. package/dist/src/components/Tabs/OrigamTabs.vue +381 -109
  191. package/dist/src/components/TextField/OrigamTextField.vue +1077 -258
  192. package/dist/src/components/TextMask/OrigamTextMask.vue +150 -43
  193. package/dist/src/components/TextareaField/OrigamTextareaField.vue +1162 -310
  194. package/dist/src/components/TextareaField/OrigamTextareaFieldRichToolbar.vue +77 -79
  195. package/dist/src/components/ThemeProvider/OrigamThemeProvider.vue +44 -9
  196. package/dist/src/components/Timeline/OrigamTimeline.vue +113 -43
  197. package/dist/src/components/Timeline/OrigamTimelineItem.vue +163 -76
  198. package/dist/src/components/Title/OrigamTitle.vue +505 -82
  199. package/dist/src/components/Toolbar/OrigamToolbar.vue +679 -142
  200. package/dist/src/components/Tooltip/OrigamTooltip.vue +288 -72
  201. package/dist/src/components/Transition/OrigamExpandX.vue +219 -106
  202. package/dist/src/components/Transition/OrigamExpandY.vue +219 -106
  203. package/dist/src/components/Transition/OrigamFade.vue +47 -9
  204. package/dist/src/components/Transition/OrigamReverseTranslatePicker.vue +52 -10
  205. package/dist/src/components/Transition/OrigamScaleRotate.vue +52 -10
  206. package/dist/src/components/Transition/OrigamSlideX.vue +52 -10
  207. package/dist/src/components/Transition/OrigamSlideY.vue +52 -10
  208. package/dist/src/components/Transition/OrigamSnack.vue +52 -10
  209. package/dist/src/components/Transition/OrigamTransition.vue +40 -12
  210. package/dist/src/components/Transition/OrigamTranslateBottom.vue +52 -10
  211. package/dist/src/components/Transition/OrigamTranslatePicker.vue +52 -10
  212. package/dist/src/components/Transition/OrigamTranslateScale.vue +209 -97
  213. package/dist/src/components/Transition/OrigamWindowXReverseTranslate.vue +40 -7
  214. package/dist/src/components/Transition/OrigamWindowXTranslate.vue +40 -7
  215. package/dist/src/components/Transition/OrigamWindowYReverseTranslate.vue +40 -7
  216. package/dist/src/components/Transition/OrigamWindowYTranslate.vue +40 -7
  217. package/dist/src/components/Treeview/OrigamTreeview.vue +258 -118
  218. package/dist/src/components/Treeview/OrigamTreeviewNode.vue +126 -88
  219. package/dist/src/components/Video/OrigamVideo.vue +1178 -331
  220. package/dist/src/components/VirtualScroll/OrigamVirtualScroll.vue +147 -55
  221. package/dist/src/components/VirtualScroll/OrigamVirtualScrollItem.vue +94 -19
  222. package/dist/src/components/Watermark/OrigamWatermark.vue +224 -124
  223. package/dist/src/components/Window/OrigamWindow.vue +745 -175
  224. package/dist/src/components/Window/OrigamWindowItem.vue +162 -69
  225. package/dist/src/composables/Commons/display.composable.cjs +2 -0
  226. package/dist/src/composables/Commons/display.composable.js +1 -1
  227. package/dist/src/interfaces/Pagination/pagination.interface.d.ts +1 -1
  228. 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
- defineOptions({
318
- name: "OrigamChartPictorial"
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
- icon: { type: String, required: false, 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" },
322
- iconColor: { type: null, required: false, default: void 0 },
323
- emptyIconColor: { type: String, required: false, default: "rgba(0,0,0,0.1)" },
324
- iconsPerUnit: { type: Number, required: false, default: 1 },
325
- direction: { type: null, required: false, default: "vertical" },
326
- mode: { type: null, required: false, default: "stack" },
327
- showLabel: { type: Boolean, required: false, default: true },
328
- showAxis: { type: Boolean, required: false, default: true },
329
- xAxisFormat: { type: Function, required: false, default: void 0 },
330
- yAxisFormat: { type: Function, required: false, default: void 0 },
331
- series: { type: Array, required: true },
332
- categories: { type: Array, required: false, default: () => [] },
333
- title: { type: String, required: false, default: void 0 },
334
- subtitle: { type: String, required: false, default: void 0 },
335
- showLegend: { type: Boolean, required: false, default: true },
336
- legendPosition: { type: null, required: false, default: "bottom" },
337
- showTooltip: { type: Boolean, required: false, default: true },
338
- animated: { type: Boolean, required: false, default: true },
339
- animationDuration: { type: Number, required: false, default: 600 },
340
- colorScheme: { type: Array, required: false, default: () => [] },
341
- aspectRatio: { type: String, required: false, default: void 0 },
342
- id: { type: String, required: false },
343
- class: { type: [String, Array, Object], required: false },
344
- style: { type: [String, Array, Object, Boolean, null], required: false, skipCheck: true },
345
- height: { type: [Number, String], required: false, default: 400 },
346
- maxHeight: { type: [Number, String], required: false },
347
- maxWidth: { type: [Number, String], required: false },
348
- minHeight: { type: [Number, String], required: false },
349
- minWidth: { type: [Number, String], required: false },
350
- width: { type: [Number, String], required: false },
351
- margin: { type: [Boolean, Number, String], required: false },
352
- marginTop: { type: [Boolean, Number, String], required: false },
353
- marginLeft: { type: [Boolean, Number, String], required: false },
354
- marginBottom: { type: [Boolean, Number, String], required: false },
355
- marginRight: { type: [Boolean, Number, String], required: false },
356
- marginBlock: { type: [Boolean, Number, String], required: false },
357
- marginInline: { type: [Boolean, Number, String], required: false },
358
- marginInlineStart: { type: [Boolean, Number, String], required: false },
359
- marginInlineEnd: { type: [Boolean, Number, String], required: false },
360
- marginBlockStart: { type: [Boolean, Number, String], required: false },
361
- marginBlockEnd: { type: [Boolean, Number, String], required: false },
362
- padding: { type: [Boolean, Number, String], required: false },
363
- paddingTop: { type: [Boolean, Number, String], required: false },
364
- paddingLeft: { type: [Boolean, Number, String], required: false },
365
- paddingBottom: { type: [Boolean, Number, String], required: false },
366
- paddingRight: { type: [Boolean, Number, String], required: false },
367
- paddingBlock: { type: [Boolean, Number, String], required: false },
368
- paddingInline: { type: [Boolean, Number, String], required: false },
369
- paddingInlineStart: { type: [Boolean, Number, String], required: false },
370
- paddingInlineEnd: { type: [Boolean, Number, String], required: false },
371
- paddingBlockStart: { type: [Boolean, Number, String], required: false },
372
- paddingBlockEnd: { type: [Boolean, Number, String], required: false },
373
- rounded: { type: [Boolean, Number, String, null], required: false, skipCheck: true },
374
- roundedTopRight: { type: [Boolean, Number, String], required: false },
375
- roundedTopLeft: { type: [Boolean, Number, String], required: false },
376
- roundedBottomLeft: { type: [Boolean, Number, String], required: false },
377
- roundedBottomRight: { type: [Boolean, Number, String], required: false },
378
- roundedStartStart: { type: [Boolean, Number, String], required: false },
379
- roundedStartEnd: { type: [Boolean, Number, String], required: false },
380
- roundedEndStart: { type: [Boolean, Number, String], required: false },
381
- roundedEndEnd: { type: [Boolean, Number, String], required: false },
382
- elevation: { type: [Number, String], required: false },
383
- bgColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
384
- fontSize: { type: null, required: false },
385
- fontWeight: { type: null, required: false }
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(["point-click", "legend-click", "series-toggle"]);
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
- "primary",
409
- "success",
410
- "warning",
411
- "danger",
412
- "info",
413
- "secondary",
414
- "ghost",
415
- "neutral"
788
+ "primary",
789
+ "success",
790
+ "warning",
791
+ "danger",
792
+ "info",
793
+ "secondary",
794
+ "ghost",
795
+ "neutral"
416
796
  ];
417
797
  const resolveColor = (raw) => {
418
- if (!raw) return "currentColor";
419
- if (/^(#|rgb|hsl|var|currentColor|transparent|linear-gradient|radial-gradient|conic-gradient)/i.test(raw)) {
420
- return raw;
421
- }
422
- if (isIntent(raw)) {
423
- return intentBgExpr(raw, "default");
424
- }
425
- return "currentColor";
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
- if (props.iconColor) return resolveColor(props.iconColor);
429
- const s = props.series?.[seriesIndex];
430
- if (s?.color) return resolveColor(s.color);
431
- const scheme = props.colorScheme?.length ? props.colorScheme : DEFAULT_PALETTE;
432
- return resolveColor(scheme[seriesIndex % scheme.length]);
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
- const hiddenSeries = ref(/* @__PURE__ */ new Set());
814
+ /*********************************************************
815
+ * Legend hidden-series set
816
+ ********************************************************/
817
+ const hiddenSeries = ref(new Set());
435
818
  const categoryLabel = (dataIndex) => {
436
- const cat = props.categories?.[dataIndex];
437
- if (cat != null) return String(cat);
438
- return `Category ${dataIndex + 1}`;
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
- if (props.yAxisFormat) return props.yAxisFormat(v);
442
- if (props.xAxisFormat) return String(props.xAxisFormat(v));
443
- return String(v);
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
- if (!props.series?.length) return 0;
447
- let max = 0;
448
- for (const s of props.series) {
449
- for (const d of s.data) {
450
- const v = typeof d === "number" ? d : d.y;
451
- if (Number.isFinite(v) && v > max) max = v;
452
- }
453
- }
454
- return max;
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
- const m = maxValue.value;
458
- if (m <= 0) return 1;
459
- return Math.ceil(m / Math.max(1, props.iconsPerUnit));
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
- const raw = rawSlotsPerColumn.value;
466
- if (raw <= MAX_SLOTS) return Math.max(1, props.iconsPerUnit);
467
- return maxValue.value / MAX_SLOTS;
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
- useUnsupportedProp(
470
- "OrigamChartPictorial",
471
- "iconsPerUnit",
472
- `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.`,
473
- () => rawSlotsPerColumn.value > MAX_SLOTS
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
- if (!props.series?.length) return 0;
477
- return Math.max(...props.series.map((s) => s.data?.length ?? 0));
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
- if (props.direction === DIRECTION.HORIZONTAL) {
484
- return svgHeight.value - axisH.value;
485
- }
486
- return svgHeight.value - axisH.value - valueLabelH.value;
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
- if (props.direction === DIRECTION.HORIZONTAL) {
490
- return svgWidth.value - axisH.value - valueLabelH.value;
491
- }
492
- return svgWidth.value;
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
- const totalCols = categoryCount.value * seriesCount.value;
498
- if (totalCols <= 0) return 0;
499
- const totalGaps = (totalCols - 1) * SERIES_GAP;
500
- if (props.direction === DIRECTION.VERTICAL) {
501
- return Math.max(4, (plotWidth.value - totalGaps) / totalCols);
502
- }
503
- const totalGapsH = (categoryCount.value - 1) * SERIES_GAP;
504
- return Math.max(4, (plotHeight.value - totalGapsH) / Math.max(1, categoryCount.value));
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
- const s = slotsPerColumn.value;
508
- if (s <= 0) return 0;
509
- if (props.direction === DIRECTION.VERTICAL) {
510
- const slotH = plotHeight.value / s - ICON_GAP;
511
- const colBound2 = columnWidth.value - ICON_GAP;
512
- return Math.max(MIN_ICON_SIZE, Math.min(slotH, colBound2));
513
- }
514
- const slotW = plotWidth.value / s - ICON_GAP;
515
- const colBound = columnWidth.value - ICON_GAP;
516
- return Math.max(MIN_ICON_SIZE, Math.min(slotW, colBound));
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
- if (!props.series?.length || categoryCount.value === 0) return [];
520
- const result = [];
521
- const colW = columnWidth.value;
522
- const iSize = iconSize.value;
523
- for (let catIdx = 0; catIdx < categoryCount.value; catIdx++) {
524
- for (let serIdx = 0; serIdx < seriesCount.value; serIdx++) {
525
- const s = props.series[serIdx];
526
- if (!s) continue;
527
- const raw = s.data[catIdx];
528
- const value = raw == null ? 0 : typeof raw === "number" ? raw : raw.y;
529
- const safeValue = Number.isFinite(value) && value >= 0 ? value : 0;
530
- const filledSlots = Math.round(safeValue / effectiveIconsPerUnit.value);
531
- const colIdx = catIdx * seriesCount.value + serIdx;
532
- const isHidden = hiddenSeries.value.has(s.name);
533
- let x;
534
- let y;
535
- if (props.direction === DIRECTION.VERTICAL) {
536
- x = PLOT_X.value + colIdx * (colW + SERIES_GAP);
537
- y = PLOT_Y.value;
538
- } else {
539
- x = PLOT_X.value;
540
- y = PLOT_Y.value + catIdx * (colW + SERIES_GAP);
541
- }
542
- result.push({
543
- seriesIndex: serIdx,
544
- dataIndex: catIdx,
545
- category: categoryLabel(catIdx),
546
- value: safeValue,
547
- formatted: formatValue(safeValue),
548
- totalSlots: slotsPerColumn.value,
549
- filledSlots: Math.min(filledSlots, slotsPerColumn.value),
550
- color: colorForSeries(serIdx),
551
- x,
552
- y,
553
- iconSize: iSize,
554
- visible: !isHidden
555
- });
556
- }
557
- }
558
- return result;
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
- if (!props.series?.length) return 0;
570
- return Math.max(...props.series.map((s) => s.data?.length ?? 0));
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
- () => fillCategoryCount.value * (props.series?.length ?? 0)
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
- const totalCols = fillTotalCols.value;
577
- if (totalCols <= 0) return 0;
578
- const totalGaps = (totalCols - 1) * FILL_GAP;
579
- return Math.max(24, (svgWidth.value - totalGaps) / totalCols);
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
- if (props.mode !== CHART_PICTORIAL_MODE.FILL) return [];
586
- if (!props.series?.length || fillCategoryCount.value === 0) return [];
587
- const result = [];
588
- const iWidth = fillIconWidth.value;
589
- const seriesLen = props.series.length;
590
- for (let catIdx = 0; catIdx < fillCategoryCount.value; catIdx++) {
591
- for (let serIdx = 0; serIdx < seriesLen; serIdx++) {
592
- const s = props.series[serIdx];
593
- if (!s) continue;
594
- const isHidden = hiddenSeries.value.has(s.name);
595
- const raw = s.data[catIdx];
596
- const value = raw == null ? 0 : typeof raw === "number" ? raw : raw.y;
597
- const safeValue = Number.isFinite(value) && value >= 0 ? value : 0;
598
- const colIdx = catIdx * seriesLen + serIdx;
599
- result.push({
600
- seriesIndex: serIdx,
601
- dataIndex: catIdx,
602
- category: categoryLabel(catIdx),
603
- value: safeValue,
604
- formatted: formatValue(safeValue),
605
- totalSlots: 1,
606
- filledSlots: 1,
607
- color: colorForSeries(serIdx),
608
- x: colIdx * (iWidth + FILL_GAP),
609
- y: PLOT_Y.value,
610
- iconSize: iWidth,
611
- visible: !isHidden
612
- });
613
- }
614
- }
615
- return result.filter((c) => c.visible);
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
- const max = maxValue.value;
621
- if (max <= 0) return 0;
622
- return Math.min(1, Math.max(0, col.value / max));
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
- const ratio = fillRatio(col);
626
- return fillIconHeight.value * (1 - ratio);
1031
+ const ratio = fillRatio(col);
1032
+ return fillIconHeight.value * (1 - ratio);
627
1033
  };
628
1034
  const fillClipHeight = (col) => {
629
- const ratio = fillRatio(col);
630
- return fillIconHeight.value * ratio;
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
- const pct = Math.round(fillRatio(col) * 100);
635
- return `${col.formatted} (${pct}%)`;
1040
+ const pct = Math.round(fillRatio(col) * 100);
1041
+ return `${col.formatted} (${pct}%)`;
636
1042
  };
637
1043
  const fillColumnAriaLabel = (col) => {
638
- const pct = Math.round(fillRatio(col) * 100);
639
- return t("origam.chart.pictorial.fill_column_aria_label", col.category, col.formatted, pct);
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
- if (props.direction === DIRECTION.HORIZONTAL) {
643
- return slotIdx * (col.iconSize + ICON_GAP);
644
- }
645
- const colW = columnWidth.value;
646
- return (colW - col.iconSize) / 2;
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
- if (props.direction === DIRECTION.HORIZONTAL) {
650
- const colW = columnWidth.value;
651
- return (colW - col.iconSize) / 2;
652
- }
653
- const totalH = slotsPerColumn.value * (col.iconSize + ICON_GAP) - ICON_GAP;
654
- const fromBottom = slotsPerColumn.value - 1 - slotIdx;
655
- return totalH - fromBottom * (col.iconSize + ICON_GAP) - col.iconSize;
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
- if (props.direction === DIRECTION.HORIZONTAL) {
659
- const usedW = slotsPerColumn.value * (col.iconSize + ICON_GAP);
660
- return usedW + VALUE_LABEL_HEIGHT / 2;
661
- }
662
- return columnWidth.value / 2;
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
- if (props.direction === DIRECTION.HORIZONTAL) {
666
- return columnWidth.value / 2;
667
- }
668
- return -VALUE_LABEL_HEIGHT / 2;
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
- if (props.xAxisFormat) return String(props.xAxisFormat(col.category));
672
- return col.category;
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
- if (!props.series?.length) return [];
676
- return props.series.map((s, i) => ({
677
- series: {
678
- ...s,
679
- visible: !hiddenSeries.value.has(s.name)
680
- },
681
- index: i,
682
- color: colorForSeries(i),
683
- visible: !hiddenSeries.value.has(s.name)
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
- if (!hoveredColKey.value) return null;
693
- return activeColumns.value.find(
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
- const col = hoveredColumn.value;
699
- if (!col || !props.series?.[col.seriesIndex]) return null;
700
- return {
701
- seriesIndex: col.seriesIndex,
702
- seriesName: props.series[col.seriesIndex].name,
703
- dataIndex: col.dataIndex,
704
- x: col.category,
705
- y: col.value,
706
- color: col.color
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
- const col = hoveredColumn.value;
711
- if (!col) return null;
712
- return props.series?.[col.seriesIndex] ?? null;
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
- if (!props.series?.length) return true;
719
- const hasData = props.series.some((s) => s.data?.length > 0);
720
- if (!hasData) return true;
721
- return activeColumns.value.length === 0;
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
- [`origam-chart-pictorial--${props.direction}`]: true,
726
- [`origam-chart-pictorial--${props.mode}`]: true,
727
- [`origam-chart-pictorial--legend-${props.legendPosition}`]: true,
728
- "origam-chart-pictorial--no-animation": !props.animated
729
- },
730
- backgroundColorClasses.value,
731
- elevationClasses.value,
732
- marginClasses.value,
733
- paddingClasses.value,
734
- roundedClasses.value,
735
- props.class
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
- const out = {};
739
- if (props.aspectRatio) {
740
- out.aspectRatio = props.aspectRatio;
741
- }
742
- Object.assign(out, chartAnimationStyle.value);
743
- return [out, props.style];
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
- "origam-chart-pictorial__body--with-side-legend": props.showLegend && (props.legendPosition === "left" || props.legendPosition === "right")
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
- const n = visibleColumns.value.length;
757
- return t("origam.chart.pictorial.desc", n);
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
- hoveredColKey.value = `${col.seriesIndex}-${col.dataIndex}`;
1183
+ hoveredColKey.value = `${col.seriesIndex}-${col.dataIndex}`;
762
1184
  };
763
1185
  const onColumnLeave = () => {
764
- hoveredColKey.value = null;
1186
+ hoveredColKey.value = null;
765
1187
  };
766
1188
  const onSvgMouseMove = (event) => {
767
- const target = svgRef.value;
768
- if (!target) return;
769
- const rect = target.getBoundingClientRect();
770
- mousePos.value = {
771
- x: event.clientX - rect.left,
772
- y: event.clientY - rect.top
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
- onColumnLeave();
1198
+ onColumnLeave();
777
1199
  };
778
1200
  const onColumnActivate = (col, event) => {
779
- hoveredColKey.value = `${col.seriesIndex}-${col.dataIndex}`;
780
- if (hoveredPoint.value) {
781
- emit("point-click", hoveredPoint.value, event);
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
- emit("legend-click", series, index);
1207
+ emit("legend-click", series, index);
786
1208
  };
787
1209
  const onSeriesToggle = (series, nextVisible) => {
788
- if (nextVisible) hiddenSeries.value.delete(series.name);
789
- else hiddenSeries.value.add(series.name);
790
- emit("series-toggle", series, nextVisible);
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