origam 2.38.1 → 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 +24 -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 +6 -6
|
@@ -223,10 +223,7 @@
|
|
|
223
223
|
|
|
224
224
|
<script lang="ts" setup>
|
|
225
225
|
import { CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
|
|
226
|
-
import {
|
|
227
|
-
computed,
|
|
228
|
-
ref
|
|
229
|
-
} from "vue";
|
|
226
|
+
import { computed, ref } from "vue";
|
|
230
227
|
import OrigamChartTooltip from "./OrigamChartTooltip.vue";
|
|
231
228
|
import { useChartHeaderTypography } from "../../composables/Chart/chart-header-typography.composable";
|
|
232
229
|
import { useChartSize } from "../../composables/Chart/chart-size.composable";
|
|
@@ -241,74 +238,446 @@ import { useMargin } from "../../composables/Commons/margin.composable";
|
|
|
241
238
|
import { usePadding } from "../../composables/Commons/padding.composable";
|
|
242
239
|
import { useRounded } from "../../composables/Commons/rounded.composable";
|
|
243
240
|
import { intentBgExpr, isIntent } from "../../utils/Commons/color.util";
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
241
|
+
/*********************************************************
|
|
242
|
+
* Global
|
|
243
|
+
*
|
|
244
|
+
* @description
|
|
245
|
+
* Rectangular heatmap chart. Renders a grid of `<rect>` cells
|
|
246
|
+
* coloured by value via CSS color-mix interpolation between
|
|
247
|
+
* two endpoints (colorRange).
|
|
248
|
+
*
|
|
249
|
+
* Common use cases:
|
|
250
|
+
* - GitHub-style contribution activity (weekday × hour)
|
|
251
|
+
* - Correlation matrices (symmetric or asymmetric)
|
|
252
|
+
* - Weekday × hour engagement heatmaps
|
|
253
|
+
*
|
|
254
|
+
* Consumes `series[0]` only. Each datum: { x, y, value }.
|
|
255
|
+
* `xCategories` / `yCategories` control axis ordering; when
|
|
256
|
+
* omitted, unique values are sorted ascending.
|
|
257
|
+
*
|
|
258
|
+
* `withDefaults` literals only, per CLAUDE.md.
|
|
259
|
+
********************************************************/
|
|
260
|
+
defineOptions({ name: "OrigamChartHeatmap" });
|
|
247
261
|
const props = defineProps({
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
262
|
+
xCategories: {
|
|
263
|
+
type: Array,
|
|
264
|
+
required: false,
|
|
265
|
+
default: () => []
|
|
266
|
+
},
|
|
267
|
+
yCategories: {
|
|
268
|
+
type: Array,
|
|
269
|
+
required: false,
|
|
270
|
+
default: () => []
|
|
271
|
+
},
|
|
272
|
+
colorRange: {
|
|
273
|
+
type: Array,
|
|
274
|
+
required: false,
|
|
275
|
+
default: () => ["info", "danger"]
|
|
276
|
+
},
|
|
277
|
+
cellGap: {
|
|
278
|
+
type: Number,
|
|
279
|
+
required: false,
|
|
280
|
+
default: 2
|
|
281
|
+
},
|
|
282
|
+
showLabel: {
|
|
283
|
+
type: Boolean,
|
|
284
|
+
required: false,
|
|
285
|
+
default: true
|
|
286
|
+
},
|
|
287
|
+
showAxis: {
|
|
288
|
+
type: Boolean,
|
|
289
|
+
required: false,
|
|
290
|
+
default: true
|
|
291
|
+
},
|
|
292
|
+
showGradientLegend: {
|
|
293
|
+
type: Boolean,
|
|
294
|
+
required: false,
|
|
295
|
+
default: true
|
|
296
|
+
},
|
|
297
|
+
legendPosition: {
|
|
298
|
+
type: null,
|
|
299
|
+
required: false,
|
|
300
|
+
default: "bottom"
|
|
301
|
+
},
|
|
302
|
+
xAxisFormat: {
|
|
303
|
+
type: Function,
|
|
304
|
+
required: false,
|
|
305
|
+
default: undefined
|
|
306
|
+
},
|
|
307
|
+
yAxisFormat: {
|
|
308
|
+
type: Function,
|
|
309
|
+
required: false,
|
|
310
|
+
default: undefined
|
|
311
|
+
},
|
|
312
|
+
series: {
|
|
313
|
+
type: Array,
|
|
314
|
+
required: true
|
|
315
|
+
},
|
|
316
|
+
categories: {
|
|
317
|
+
type: Array,
|
|
318
|
+
required: false,
|
|
319
|
+
default: () => []
|
|
320
|
+
},
|
|
321
|
+
title: {
|
|
322
|
+
type: String,
|
|
323
|
+
required: false,
|
|
324
|
+
default: undefined
|
|
325
|
+
},
|
|
326
|
+
subtitle: {
|
|
327
|
+
type: String,
|
|
328
|
+
required: false,
|
|
329
|
+
default: undefined
|
|
330
|
+
},
|
|
331
|
+
showLegend: {
|
|
332
|
+
type: Boolean,
|
|
333
|
+
required: false,
|
|
334
|
+
default: true
|
|
335
|
+
},
|
|
336
|
+
showTooltip: {
|
|
337
|
+
type: Boolean,
|
|
338
|
+
required: false,
|
|
339
|
+
default: true
|
|
340
|
+
},
|
|
341
|
+
animated: {
|
|
342
|
+
type: Boolean,
|
|
343
|
+
required: false,
|
|
344
|
+
default: true
|
|
345
|
+
},
|
|
346
|
+
animationDuration: {
|
|
347
|
+
type: Number,
|
|
348
|
+
required: false,
|
|
349
|
+
default: 600
|
|
350
|
+
},
|
|
351
|
+
colorScheme: {
|
|
352
|
+
type: Array,
|
|
353
|
+
required: false,
|
|
354
|
+
default: () => []
|
|
355
|
+
},
|
|
356
|
+
aspectRatio: {
|
|
357
|
+
type: String,
|
|
358
|
+
required: false,
|
|
359
|
+
default: undefined
|
|
360
|
+
},
|
|
361
|
+
id: {
|
|
362
|
+
type: String,
|
|
363
|
+
required: false
|
|
364
|
+
},
|
|
365
|
+
class: {
|
|
366
|
+
type: [
|
|
367
|
+
String,
|
|
368
|
+
Array,
|
|
369
|
+
Object
|
|
370
|
+
],
|
|
371
|
+
required: false
|
|
372
|
+
},
|
|
373
|
+
style: {
|
|
374
|
+
type: [
|
|
375
|
+
String,
|
|
376
|
+
Array,
|
|
377
|
+
Object,
|
|
378
|
+
Boolean,
|
|
379
|
+
null
|
|
380
|
+
],
|
|
381
|
+
required: false,
|
|
382
|
+
skipCheck: true
|
|
383
|
+
},
|
|
384
|
+
height: {
|
|
385
|
+
type: [Number, String],
|
|
386
|
+
required: false,
|
|
387
|
+
default: 400
|
|
388
|
+
},
|
|
389
|
+
maxHeight: {
|
|
390
|
+
type: [Number, String],
|
|
391
|
+
required: false
|
|
392
|
+
},
|
|
393
|
+
maxWidth: {
|
|
394
|
+
type: [Number, String],
|
|
395
|
+
required: false
|
|
396
|
+
},
|
|
397
|
+
minHeight: {
|
|
398
|
+
type: [Number, String],
|
|
399
|
+
required: false
|
|
400
|
+
},
|
|
401
|
+
minWidth: {
|
|
402
|
+
type: [Number, String],
|
|
403
|
+
required: false
|
|
404
|
+
},
|
|
405
|
+
width: {
|
|
406
|
+
type: [Number, String],
|
|
407
|
+
required: false
|
|
408
|
+
},
|
|
409
|
+
margin: {
|
|
410
|
+
type: [
|
|
411
|
+
Boolean,
|
|
412
|
+
Number,
|
|
413
|
+
String
|
|
414
|
+
],
|
|
415
|
+
required: false
|
|
416
|
+
},
|
|
417
|
+
marginTop: {
|
|
418
|
+
type: [
|
|
419
|
+
Boolean,
|
|
420
|
+
Number,
|
|
421
|
+
String
|
|
422
|
+
],
|
|
423
|
+
required: false
|
|
424
|
+
},
|
|
425
|
+
marginLeft: {
|
|
426
|
+
type: [
|
|
427
|
+
Boolean,
|
|
428
|
+
Number,
|
|
429
|
+
String
|
|
430
|
+
],
|
|
431
|
+
required: false
|
|
432
|
+
},
|
|
433
|
+
marginBottom: {
|
|
434
|
+
type: [
|
|
435
|
+
Boolean,
|
|
436
|
+
Number,
|
|
437
|
+
String
|
|
438
|
+
],
|
|
439
|
+
required: false
|
|
440
|
+
},
|
|
441
|
+
marginRight: {
|
|
442
|
+
type: [
|
|
443
|
+
Boolean,
|
|
444
|
+
Number,
|
|
445
|
+
String
|
|
446
|
+
],
|
|
447
|
+
required: false
|
|
448
|
+
},
|
|
449
|
+
marginBlock: {
|
|
450
|
+
type: [
|
|
451
|
+
Boolean,
|
|
452
|
+
Number,
|
|
453
|
+
String
|
|
454
|
+
],
|
|
455
|
+
required: false
|
|
456
|
+
},
|
|
457
|
+
marginInline: {
|
|
458
|
+
type: [
|
|
459
|
+
Boolean,
|
|
460
|
+
Number,
|
|
461
|
+
String
|
|
462
|
+
],
|
|
463
|
+
required: false
|
|
464
|
+
},
|
|
465
|
+
marginInlineStart: {
|
|
466
|
+
type: [
|
|
467
|
+
Boolean,
|
|
468
|
+
Number,
|
|
469
|
+
String
|
|
470
|
+
],
|
|
471
|
+
required: false
|
|
472
|
+
},
|
|
473
|
+
marginInlineEnd: {
|
|
474
|
+
type: [
|
|
475
|
+
Boolean,
|
|
476
|
+
Number,
|
|
477
|
+
String
|
|
478
|
+
],
|
|
479
|
+
required: false
|
|
480
|
+
},
|
|
481
|
+
marginBlockStart: {
|
|
482
|
+
type: [
|
|
483
|
+
Boolean,
|
|
484
|
+
Number,
|
|
485
|
+
String
|
|
486
|
+
],
|
|
487
|
+
required: false
|
|
488
|
+
},
|
|
489
|
+
marginBlockEnd: {
|
|
490
|
+
type: [
|
|
491
|
+
Boolean,
|
|
492
|
+
Number,
|
|
493
|
+
String
|
|
494
|
+
],
|
|
495
|
+
required: false
|
|
496
|
+
},
|
|
497
|
+
padding: {
|
|
498
|
+
type: [
|
|
499
|
+
Boolean,
|
|
500
|
+
Number,
|
|
501
|
+
String
|
|
502
|
+
],
|
|
503
|
+
required: false
|
|
504
|
+
},
|
|
505
|
+
paddingTop: {
|
|
506
|
+
type: [
|
|
507
|
+
Boolean,
|
|
508
|
+
Number,
|
|
509
|
+
String
|
|
510
|
+
],
|
|
511
|
+
required: false
|
|
512
|
+
},
|
|
513
|
+
paddingLeft: {
|
|
514
|
+
type: [
|
|
515
|
+
Boolean,
|
|
516
|
+
Number,
|
|
517
|
+
String
|
|
518
|
+
],
|
|
519
|
+
required: false
|
|
520
|
+
},
|
|
521
|
+
paddingBottom: {
|
|
522
|
+
type: [
|
|
523
|
+
Boolean,
|
|
524
|
+
Number,
|
|
525
|
+
String
|
|
526
|
+
],
|
|
527
|
+
required: false
|
|
528
|
+
},
|
|
529
|
+
paddingRight: {
|
|
530
|
+
type: [
|
|
531
|
+
Boolean,
|
|
532
|
+
Number,
|
|
533
|
+
String
|
|
534
|
+
],
|
|
535
|
+
required: false
|
|
536
|
+
},
|
|
537
|
+
paddingBlock: {
|
|
538
|
+
type: [
|
|
539
|
+
Boolean,
|
|
540
|
+
Number,
|
|
541
|
+
String
|
|
542
|
+
],
|
|
543
|
+
required: false
|
|
544
|
+
},
|
|
545
|
+
paddingInline: {
|
|
546
|
+
type: [
|
|
547
|
+
Boolean,
|
|
548
|
+
Number,
|
|
549
|
+
String
|
|
550
|
+
],
|
|
551
|
+
required: false
|
|
552
|
+
},
|
|
553
|
+
paddingInlineStart: {
|
|
554
|
+
type: [
|
|
555
|
+
Boolean,
|
|
556
|
+
Number,
|
|
557
|
+
String
|
|
558
|
+
],
|
|
559
|
+
required: false
|
|
560
|
+
},
|
|
561
|
+
paddingInlineEnd: {
|
|
562
|
+
type: [
|
|
563
|
+
Boolean,
|
|
564
|
+
Number,
|
|
565
|
+
String
|
|
566
|
+
],
|
|
567
|
+
required: false
|
|
568
|
+
},
|
|
569
|
+
paddingBlockStart: {
|
|
570
|
+
type: [
|
|
571
|
+
Boolean,
|
|
572
|
+
Number,
|
|
573
|
+
String
|
|
574
|
+
],
|
|
575
|
+
required: false
|
|
576
|
+
},
|
|
577
|
+
paddingBlockEnd: {
|
|
578
|
+
type: [
|
|
579
|
+
Boolean,
|
|
580
|
+
Number,
|
|
581
|
+
String
|
|
582
|
+
],
|
|
583
|
+
required: false
|
|
584
|
+
},
|
|
585
|
+
rounded: {
|
|
586
|
+
type: [
|
|
587
|
+
Boolean,
|
|
588
|
+
Number,
|
|
589
|
+
String,
|
|
590
|
+
null
|
|
591
|
+
],
|
|
592
|
+
required: false,
|
|
593
|
+
skipCheck: true
|
|
594
|
+
},
|
|
595
|
+
roundedTopRight: {
|
|
596
|
+
type: [
|
|
597
|
+
Boolean,
|
|
598
|
+
Number,
|
|
599
|
+
String
|
|
600
|
+
],
|
|
601
|
+
required: false
|
|
602
|
+
},
|
|
603
|
+
roundedTopLeft: {
|
|
604
|
+
type: [
|
|
605
|
+
Boolean,
|
|
606
|
+
Number,
|
|
607
|
+
String
|
|
608
|
+
],
|
|
609
|
+
required: false
|
|
610
|
+
},
|
|
611
|
+
roundedBottomLeft: {
|
|
612
|
+
type: [
|
|
613
|
+
Boolean,
|
|
614
|
+
Number,
|
|
615
|
+
String
|
|
616
|
+
],
|
|
617
|
+
required: false
|
|
618
|
+
},
|
|
619
|
+
roundedBottomRight: {
|
|
620
|
+
type: [
|
|
621
|
+
Boolean,
|
|
622
|
+
Number,
|
|
623
|
+
String
|
|
624
|
+
],
|
|
625
|
+
required: false
|
|
626
|
+
},
|
|
627
|
+
roundedStartStart: {
|
|
628
|
+
type: [
|
|
629
|
+
Boolean,
|
|
630
|
+
Number,
|
|
631
|
+
String
|
|
632
|
+
],
|
|
633
|
+
required: false
|
|
634
|
+
},
|
|
635
|
+
roundedStartEnd: {
|
|
636
|
+
type: [
|
|
637
|
+
Boolean,
|
|
638
|
+
Number,
|
|
639
|
+
String
|
|
640
|
+
],
|
|
641
|
+
required: false
|
|
642
|
+
},
|
|
643
|
+
roundedEndStart: {
|
|
644
|
+
type: [
|
|
645
|
+
Boolean,
|
|
646
|
+
Number,
|
|
647
|
+
String
|
|
648
|
+
],
|
|
649
|
+
required: false
|
|
650
|
+
},
|
|
651
|
+
roundedEndEnd: {
|
|
652
|
+
type: [
|
|
653
|
+
Boolean,
|
|
654
|
+
Number,
|
|
655
|
+
String
|
|
656
|
+
],
|
|
657
|
+
required: false
|
|
658
|
+
},
|
|
659
|
+
elevation: {
|
|
660
|
+
type: [Number, String],
|
|
661
|
+
required: false
|
|
662
|
+
},
|
|
663
|
+
bgColor: {
|
|
664
|
+
type: [
|
|
665
|
+
String,
|
|
666
|
+
Object,
|
|
667
|
+
Boolean,
|
|
668
|
+
null
|
|
669
|
+
],
|
|
670
|
+
required: false,
|
|
671
|
+
skipCheck: true
|
|
672
|
+
},
|
|
673
|
+
fontSize: {
|
|
674
|
+
type: null,
|
|
675
|
+
required: false
|
|
676
|
+
},
|
|
677
|
+
fontWeight: {
|
|
678
|
+
type: null,
|
|
679
|
+
required: false
|
|
680
|
+
}
|
|
312
681
|
});
|
|
313
682
|
const emit = defineEmits(["point-click"]);
|
|
314
683
|
defineSlots();
|
|
@@ -320,13 +689,20 @@ const { marginClasses, marginStyles } = useMargin(props);
|
|
|
320
689
|
const { paddingClasses, paddingStyles } = usePadding(props);
|
|
321
690
|
const { roundedClasses, roundedStyles } = useRounded(props);
|
|
322
691
|
const { headerTypographyStyles } = useChartHeaderTypography(props);
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
692
|
+
/*********************************************************
|
|
693
|
+
* Props heritees sans effet ici (#426)
|
|
694
|
+
*
|
|
695
|
+
* @description
|
|
696
|
+
* ⛔ Ces props sont declarees par `IChartBaseProps` et n'ont aucun
|
|
697
|
+
* effet sur ce composant. Elles ne sont ni retirees ni cablees a un
|
|
698
|
+
* comportement fictif : elles avertissent une fois, en dev, avec la
|
|
699
|
+
* raison exacte. Meme traitement que `OrigamChartGauge`.
|
|
700
|
+
********************************************************/
|
|
701
|
+
useUnsupportedProp("OrigamChartHeatmap", "categories", "a heatmap labels its axes from the cell coordinates carried by `series[].data`, never from a separate category list.", () => (props.categories?.length ?? 0) > 0);
|
|
329
702
|
const chartAnimationStyle = useChartAnimationStyle(props);
|
|
703
|
+
/*********************************************************
|
|
704
|
+
* SVG coordinate constants
|
|
705
|
+
********************************************************/
|
|
330
706
|
const AXIS_LEFT = 48;
|
|
331
707
|
const AXIS_BOTTOM = 28;
|
|
332
708
|
const LEGEND_H = 14;
|
|
@@ -334,76 +710,99 @@ const LEGEND_MARGIN = 24;
|
|
|
334
710
|
const LABEL_MIN_CELL = 18;
|
|
335
711
|
const SVG_PLOT_W = 560;
|
|
336
712
|
const SVG_PLOT_H = 340;
|
|
713
|
+
/*********************************************************
|
|
714
|
+
* Colour helpers
|
|
715
|
+
********************************************************/
|
|
337
716
|
const resolveColor = (raw) => {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
717
|
+
if (!raw) return "currentColor";
|
|
718
|
+
if (/^(#|rgb|hsl|var|currentColor|transparent|linear-gradient|radial-gradient|conic-gradient)/i.test(raw)) {
|
|
719
|
+
return raw;
|
|
720
|
+
}
|
|
721
|
+
if (isIntent(raw)) {
|
|
722
|
+
return intentBgExpr(raw, "default");
|
|
723
|
+
}
|
|
724
|
+
return "currentColor";
|
|
346
725
|
};
|
|
347
726
|
const heatmapColorFor = (value, minVal, maxVal) => {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
727
|
+
const range = maxVal - minVal;
|
|
728
|
+
const pct = range === 0 ? 0 : Math.round((value - minVal) / range * 100);
|
|
729
|
+
const start = resolveColor(props.colorRange[0]);
|
|
730
|
+
const end = resolveColor(props.colorRange[1]);
|
|
731
|
+
return `color-mix(in srgb, ${end} ${pct}%, ${start})`;
|
|
353
732
|
};
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
)
|
|
733
|
+
/*********************************************************
|
|
734
|
+
* useUnsupportedProp
|
|
735
|
+
*
|
|
736
|
+
* @description
|
|
737
|
+
* ⛔ #426 — `colorScheme` is inherited from `IChartBaseProps` but has no
|
|
738
|
+
* effect here: cell colour is a CONTINUOUS two-stop gradient (`colorRange`),
|
|
739
|
+
* not a per-series identity a rotating discrete palette could drive. See
|
|
740
|
+
* #426 decision: neither wiring a fake behaviour nor removing the prop —
|
|
741
|
+
* warn instead.
|
|
742
|
+
********************************************************/
|
|
743
|
+
useUnsupportedProp("OrigamChartHeatmap", "colorScheme", "cell colour is a continuous gradient (colorRange) — a rotating discrete palette does not apply to a continuous scale.", () => !!props.colorScheme?.length);
|
|
744
|
+
/*********************************************************
|
|
745
|
+
* Data derivation
|
|
746
|
+
********************************************************/
|
|
360
747
|
const rawData = computed(() => {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
748
|
+
const series = props.series?.[0];
|
|
749
|
+
if (!series?.data?.length) return [];
|
|
750
|
+
return series.data;
|
|
364
751
|
});
|
|
365
752
|
const xCats = computed(() => {
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
753
|
+
if (props.xCategories?.length) return props.xCategories;
|
|
754
|
+
const vals = [...new Set(rawData.value.map((d) => String(d.x)))];
|
|
755
|
+
return vals.sort((a, b) => {
|
|
756
|
+
const na = Number(a);
|
|
757
|
+
const nb = Number(b);
|
|
758
|
+
if (!isNaN(na) && !isNaN(nb)) return na - nb;
|
|
759
|
+
return a.localeCompare(b);
|
|
760
|
+
});
|
|
374
761
|
});
|
|
375
762
|
const yCats = computed(() => {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
763
|
+
if (props.yCategories?.length) return props.yCategories;
|
|
764
|
+
const vals = [...new Set(rawData.value.map((d) => String(d.y)))];
|
|
765
|
+
return vals.sort((a, b) => {
|
|
766
|
+
const na = Number(a);
|
|
767
|
+
const nb = Number(b);
|
|
768
|
+
if (!isNaN(na) && !isNaN(nb)) return na - nb;
|
|
769
|
+
return a.localeCompare(b);
|
|
770
|
+
});
|
|
384
771
|
});
|
|
385
772
|
const valueRange = computed(() => {
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
773
|
+
const vals = rawData.value.map((d) => d.value).filter((v) => Number.isFinite(v));
|
|
774
|
+
if (!vals.length) return {
|
|
775
|
+
min: 0,
|
|
776
|
+
max: 1
|
|
777
|
+
};
|
|
778
|
+
return {
|
|
779
|
+
min: Math.min(...vals),
|
|
780
|
+
max: Math.max(...vals)
|
|
781
|
+
};
|
|
389
782
|
});
|
|
390
783
|
const formatValue = (v) => {
|
|
391
|
-
|
|
392
|
-
|
|
784
|
+
if (props.yAxisFormat) return props.yAxisFormat(v);
|
|
785
|
+
return String(v);
|
|
393
786
|
};
|
|
394
787
|
const formatXLabel = (v) => {
|
|
395
|
-
|
|
396
|
-
|
|
788
|
+
if (props.xAxisFormat) return props.xAxisFormat(v);
|
|
789
|
+
return String(v);
|
|
397
790
|
};
|
|
791
|
+
/*********************************************************
|
|
792
|
+
* SVG geometry
|
|
793
|
+
********************************************************/
|
|
398
794
|
const isLegendInline = computed(() => props.legendPosition === "bottom" || props.legendPosition === "top");
|
|
399
|
-
const legendExtraH = computed(
|
|
400
|
-
|
|
401
|
-
|
|
795
|
+
const legendExtraH = computed(() => props.showGradientLegend && isLegendInline.value ? LEGEND_H + LEGEND_MARGIN : 0);
|
|
796
|
+
/*********************************************************
|
|
797
|
+
* Surface mesuree — repli = ancien viewBox fige (axe gauche + 560
|
|
798
|
+
* de trace ; 340 de trace + axe bas + legende). Le getter garde la
|
|
799
|
+
* legende reactive.
|
|
800
|
+
********************************************************/
|
|
402
801
|
const { resizeRef: svgRef, width: svgWidth, height: svgHeight } = useChartSize({
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
802
|
+
width: AXIS_LEFT + SVG_PLOT_W,
|
|
803
|
+
get height() {
|
|
804
|
+
return SVG_PLOT_H + AXIS_BOTTOM + legendExtraH.value;
|
|
805
|
+
}
|
|
407
806
|
});
|
|
408
807
|
const { onKeydown: onChartKeydown } = useChartRoving(svgRef);
|
|
409
808
|
const plotX0 = AXIS_LEFT;
|
|
@@ -413,176 +812,203 @@ const plotH = computed(() => Math.max(0, svgHeight.value - AXIS_BOTTOM - legendE
|
|
|
413
812
|
const nx = computed(() => xCats.value.length);
|
|
414
813
|
const ny = computed(() => yCats.value.length);
|
|
415
814
|
const cellW = computed(() => {
|
|
416
|
-
|
|
417
|
-
|
|
815
|
+
if (!nx.value) return 0;
|
|
816
|
+
return (plotW.value - props.cellGap * (nx.value - 1)) / nx.value;
|
|
418
817
|
});
|
|
419
818
|
const cellH = computed(() => {
|
|
420
|
-
|
|
421
|
-
|
|
819
|
+
if (!ny.value) return 0;
|
|
820
|
+
return (plotH.value - props.cellGap * (ny.value - 1)) / ny.value;
|
|
422
821
|
});
|
|
822
|
+
/*********************************************************
|
|
823
|
+
* Cell descriptors
|
|
824
|
+
********************************************************/
|
|
423
825
|
const cells = computed(() => {
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
826
|
+
if (!rawData.value.length) return [];
|
|
827
|
+
const { min, max } = valueRange.value;
|
|
828
|
+
return rawData.value.map((d, i) => {
|
|
829
|
+
const xIdx = xCats.value.indexOf(String(d.x));
|
|
830
|
+
const yIdx = yCats.value.indexOf(String(d.y));
|
|
831
|
+
if (xIdx === -1 || yIdx === -1) return null;
|
|
832
|
+
const rx = plotX0 + xIdx * (cellW.value + props.cellGap);
|
|
833
|
+
const ry = plotY0 + yIdx * (cellH.value + props.cellGap);
|
|
834
|
+
const rw = cellW.value;
|
|
835
|
+
const rh = cellH.value;
|
|
836
|
+
return {
|
|
837
|
+
index: i,
|
|
838
|
+
xCat: String(d.x),
|
|
839
|
+
yCat: String(d.y),
|
|
840
|
+
value: d.value,
|
|
841
|
+
color: heatmapColorFor(d.value, min, max),
|
|
842
|
+
rx,
|
|
843
|
+
ry,
|
|
844
|
+
rw,
|
|
845
|
+
rh,
|
|
846
|
+
labelX: rx + rw / 2,
|
|
847
|
+
labelY: ry + rh / 2,
|
|
848
|
+
labelFits: rw >= LABEL_MIN_CELL && rh >= LABEL_MIN_CELL,
|
|
849
|
+
visible: true
|
|
850
|
+
};
|
|
851
|
+
}).filter((c) => c !== null);
|
|
450
852
|
});
|
|
451
853
|
const visibleCells = computed(() => cells.value.filter((c) => c.visible));
|
|
854
|
+
/*********************************************************
|
|
855
|
+
* Axis labels — skip every other label if N > 20
|
|
856
|
+
********************************************************/
|
|
452
857
|
const xAxisY = computed(() => plotY0 + plotH.value + 4);
|
|
453
858
|
const yAxisX = computed(() => plotX0 - 6);
|
|
454
859
|
const xAxisLabels = computed(() => {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
860
|
+
const cats = xCats.value;
|
|
861
|
+
if (cats.length <= 20) return cats.map(formatXLabel);
|
|
862
|
+
return cats.map((c, i) => i % 2 === 0 ? formatXLabel(c) : "");
|
|
458
863
|
});
|
|
459
864
|
const formatYLabel = (cat) => {
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
865
|
+
const num = Number(cat);
|
|
866
|
+
if (!isNaN(num) && props.yAxisFormat) return props.yAxisFormat(num);
|
|
867
|
+
return cat;
|
|
463
868
|
};
|
|
464
869
|
const yAxisLabels = computed(() => {
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
870
|
+
const cats = yCats.value;
|
|
871
|
+
if (cats.length <= 20) return cats.map(formatYLabel);
|
|
872
|
+
return cats.map((c, i) => i % 2 === 0 ? formatYLabel(c) : "");
|
|
468
873
|
});
|
|
469
|
-
const xLabelPositions = computed(
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
);
|
|
874
|
+
const xLabelPositions = computed(() => xCats.value.map((_, i) => plotX0 + i * (cellW.value + props.cellGap) + cellW.value / 2));
|
|
875
|
+
const yLabelPositions = computed(() => yCats.value.map((_, i) => plotY0 + i * (cellH.value + props.cellGap) + cellH.value / 2));
|
|
876
|
+
/*********************************************************
|
|
877
|
+
* Gradient legend rect (inline, bottom of SVG)
|
|
878
|
+
********************************************************/
|
|
475
879
|
const gradientRect = computed(() => {
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
880
|
+
const legendY = props.legendPosition === "top" ? 0 : plotY0 + plotH.value + AXIS_BOTTOM;
|
|
881
|
+
return {
|
|
882
|
+
x: plotX0,
|
|
883
|
+
y: legendY,
|
|
884
|
+
w: plotW.value,
|
|
885
|
+
h: LEGEND_H
|
|
886
|
+
};
|
|
887
|
+
});
|
|
888
|
+
/*********************************************************
|
|
889
|
+
* Hover / tooltip
|
|
890
|
+
********************************************************/
|
|
891
|
+
const mousePos = ref({
|
|
892
|
+
x: 0,
|
|
893
|
+
y: 0
|
|
483
894
|
});
|
|
484
|
-
const mousePos = ref({ x: 0, y: 0 });
|
|
485
895
|
const hoveredIndex = ref(null);
|
|
486
896
|
const hoveredCell = computed(() => {
|
|
487
|
-
|
|
488
|
-
|
|
897
|
+
if (hoveredIndex.value === null) return null;
|
|
898
|
+
return visibleCells.value.find((c) => c.index === hoveredIndex.value) ?? null;
|
|
489
899
|
});
|
|
490
900
|
const hoveredPoint = computed(() => {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
901
|
+
const c = hoveredCell.value;
|
|
902
|
+
if (!c || !props.series?.[0]) return null;
|
|
903
|
+
return {
|
|
904
|
+
seriesIndex: 0,
|
|
905
|
+
seriesName: props.series[0].name,
|
|
906
|
+
dataIndex: c.index,
|
|
907
|
+
x: c.xCat,
|
|
908
|
+
y: c.value,
|
|
909
|
+
color: c.color
|
|
910
|
+
};
|
|
501
911
|
});
|
|
502
912
|
const hoveredSeries = computed(() => {
|
|
503
|
-
|
|
504
|
-
|
|
913
|
+
if (!hoveredCell.value || !props.series?.[0]) return null;
|
|
914
|
+
return props.series[0];
|
|
505
915
|
});
|
|
506
916
|
const hoveredCategory = computed(() => {
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
917
|
+
const c = hoveredCell.value;
|
|
918
|
+
if (!c) return "";
|
|
919
|
+
return `${c.xCat} × ${c.yCat}`;
|
|
510
920
|
});
|
|
921
|
+
/*********************************************************
|
|
922
|
+
* enrichedTooltipBindings
|
|
923
|
+
*
|
|
924
|
+
* @description
|
|
925
|
+
* Enriches the default `{ point, series, category }` tooltip scope
|
|
926
|
+
* with the cell-level fields `IChartHeatmapSlots['tooltip']`
|
|
927
|
+
* promises (`color`, `xLabel`, `yLabel`, `value`) — sourced from
|
|
928
|
+
* `hoveredCell`, which already carries them. Was previously
|
|
929
|
+
* forwarding the raw `bindings` unmodified, silently never
|
|
930
|
+
* fulfilling the documented tooltip slot signature.
|
|
931
|
+
********************************************************/
|
|
511
932
|
const enrichedTooltipBindings = (bindings) => {
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
933
|
+
const c = hoveredCell.value;
|
|
934
|
+
return {
|
|
935
|
+
...bindings,
|
|
936
|
+
color: c?.color ?? "",
|
|
937
|
+
xLabel: c ? formatXLabel(c.xCat) : "",
|
|
938
|
+
yLabel: c ? formatYLabel(c.yCat) : "",
|
|
939
|
+
value: c?.value ?? 0
|
|
940
|
+
};
|
|
520
941
|
};
|
|
521
942
|
const showEmpty = computed(() => {
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
943
|
+
if (!props.series?.length) return true;
|
|
944
|
+
const first = props.series[0];
|
|
945
|
+
if (!first?.data?.length) return true;
|
|
946
|
+
return visibleCells.value.length === 0;
|
|
526
947
|
});
|
|
948
|
+
/*********************************************************
|
|
949
|
+
* Root classes / styles
|
|
950
|
+
********************************************************/
|
|
527
951
|
const rootClasses = computed(() => [
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
952
|
+
{
|
|
953
|
+
[`origam-chart-heatmap--legend-${props.legendPosition}`]: true,
|
|
954
|
+
"origam-chart-heatmap--no-animation": !props.animated
|
|
955
|
+
},
|
|
956
|
+
backgroundColorClasses.value,
|
|
957
|
+
elevationClasses.value,
|
|
958
|
+
marginClasses.value,
|
|
959
|
+
paddingClasses.value,
|
|
960
|
+
roundedClasses.value,
|
|
961
|
+
props.class
|
|
538
962
|
]);
|
|
539
963
|
const rootStyles = computed(() => {
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
964
|
+
const out = {};
|
|
965
|
+
if (props.aspectRatio) {
|
|
966
|
+
out.aspectRatio = props.aspectRatio;
|
|
967
|
+
}
|
|
968
|
+
Object.assign(out, chartAnimationStyle.value);
|
|
969
|
+
return [out, props.style];
|
|
546
970
|
});
|
|
547
|
-
const bodyClasses = computed(() => ({
|
|
548
|
-
|
|
549
|
-
}));
|
|
550
|
-
const svgClasses = computed(() => ({
|
|
551
|
-
"origam-chart__svg--animated": props.animated
|
|
552
|
-
}));
|
|
971
|
+
const bodyClasses = computed(() => ({ "origam-chart-heatmap__body--with-side-legend": props.showLegend && (props.legendPosition === "left" || props.legendPosition === "right") }));
|
|
972
|
+
const svgClasses = computed(() => ({ "origam-chart__svg--animated": props.animated }));
|
|
553
973
|
const hasTitleBlock = computed(() => Boolean(props.title || props.subtitle));
|
|
974
|
+
/*********************************************************
|
|
975
|
+
* ARIA
|
|
976
|
+
********************************************************/
|
|
554
977
|
const ariaLabel = computed(() => props.title ?? t("origam.chart.heatmap.aria_label"));
|
|
555
978
|
const svgAriaLabel = computed(() => props.title ?? t("origam.chart.heatmap.aria_label"));
|
|
556
979
|
const svgTitle = computed(() => props.title ?? t("origam.chart.heatmap.aria_label"));
|
|
557
980
|
const svgDesc = computed(() => {
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
981
|
+
const nx2 = xCats.value.length;
|
|
982
|
+
const ny2 = yCats.value.length;
|
|
983
|
+
return t("origam.chart.heatmap.desc", nx2, ny2);
|
|
561
984
|
});
|
|
562
|
-
const cellAriaLabel = (cell) => `${cell.xCat}
|
|
985
|
+
const cellAriaLabel = (cell) => `${cell.xCat} × ${cell.yCat}: ${formatValue(cell.value)}`;
|
|
986
|
+
/*********************************************************
|
|
987
|
+
* Interaction
|
|
988
|
+
********************************************************/
|
|
563
989
|
const onCellEnter = (cell) => {
|
|
564
|
-
|
|
990
|
+
hoveredIndex.value = cell.index;
|
|
565
991
|
};
|
|
566
992
|
const onCellLeave = () => {
|
|
567
|
-
|
|
993
|
+
hoveredIndex.value = null;
|
|
568
994
|
};
|
|
569
995
|
const onSvgMouseMove = (event) => {
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
996
|
+
const target = svgRef.value;
|
|
997
|
+
if (!target) return;
|
|
998
|
+
const rect = target.getBoundingClientRect();
|
|
999
|
+
mousePos.value = {
|
|
1000
|
+
x: event.clientX - rect.left,
|
|
1001
|
+
y: event.clientY - rect.top
|
|
1002
|
+
};
|
|
577
1003
|
};
|
|
578
1004
|
const onSvgMouseLeave = () => {
|
|
579
|
-
|
|
1005
|
+
onCellLeave();
|
|
580
1006
|
};
|
|
581
1007
|
const onCellActivate = (cell, event) => {
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
1008
|
+
hoveredIndex.value = cell.index;
|
|
1009
|
+
if (hoveredPoint.value) {
|
|
1010
|
+
emit("point-click", hoveredPoint.value, event);
|
|
1011
|
+
}
|
|
586
1012
|
};
|
|
587
1013
|
</script>
|
|
588
1014
|
|