origam 2.37.35 → 2.37.37
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 +23 -0
- package/dist/src/components/Chart/OrigamChartBoxPlot.vue +2 -1
- package/dist/src/components/Chart/OrigamChartBullet.vue +2 -1
- package/dist/src/components/Chart/OrigamChartCandlestick.vue +2 -1
- package/dist/src/components/Chart/OrigamChartCartesian.vue +14 -10
- package/dist/src/components/Chart/OrigamChartHeatmap.vue +2 -1
- package/dist/src/components/Chart/OrigamChartHoneycomb.vue +2 -1
- package/dist/src/components/Chart/OrigamChartMap.vue +2 -1
- package/dist/src/components/Chart/OrigamChartPareto.vue +2 -1
- package/dist/src/components/Chart/OrigamChartPictorial.vue +2 -1
- package/dist/src/components/Chart/OrigamChartPolar.vue +2 -1
- package/dist/src/components/Chart/OrigamChartPolarBar.vue +2 -1
- package/dist/src/components/Chart/OrigamChartPyramid.vue +2 -1
- package/dist/src/components/Chart/OrigamChartRadar.vue +2 -1
- package/dist/src/components/Chart/OrigamChartSankey.vue +2 -1
- package/dist/src/components/Chart/OrigamChartSparkline.vue +2 -1
- package/dist/src/components/Chart/OrigamChartStreamgraph.vue +2 -1
- package/dist/src/components/Chart/OrigamChartSunburst.vue +2 -1
- package/dist/src/components/Chart/OrigamChartTreemap.vue +2 -1
- package/dist/src/components/Chart/OrigamChartVariwide.vue +2 -1
- package/dist/src/components/Chart/OrigamChartWordCloud.vue +2 -1
- package/dist/src/composables/Chart/chart-size.composable.cjs +21 -0
- package/dist/src/composables/Chart/chart-size.composable.d.ts +18 -0
- package/dist/src/composables/Chart/chart-size.composable.js +8 -0
- package/dist/src/composables/Commons/resizeObserver.composable.d.ts +1 -1
- package/dist/src/composables/index.cjs +12 -0
- package/dist/src/composables/index.d.ts +1 -0
- package/dist/src/composables/index.js +1 -0
- package/dist/src/consts/Chart/chart.const.cjs +3 -2
- package/dist/src/consts/Chart/chart.const.d.ts +13 -0
- package/dist/src/consts/Chart/chart.const.js +1 -0
- package/dist/src/interfaces/Commons/resizeObserver.interface.d.ts +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -18,6 +18,29 @@ This project follows [Semantic Versioning](https://semver.org).
|
|
|
18
18
|
|
|
19
19
|
## [Unreleased]
|
|
20
20
|
|
|
21
|
+
## [2.37.37] - 2026-11-04
|
|
22
|
+
|
|
23
|
+
### Fixed — `OrigamChartCartesian` : la surface de dessin suit la largeur réelle du conteneur (#1317)
|
|
24
|
+
|
|
25
|
+
Le `viewBox` était figé à une taille fixe : le chart s'étirait sans recalculer ses axes ni ses marges.
|
|
26
|
+
|
|
27
|
+
- Nouveau composable `useChartSize` (`composables/Chart/chart-size.composable.ts`), construit sur `useResizeObserver` : il mesure le `<svg>` et recalcule le `viewBox`. En SSR et avant la première mesure, il retombe sur 600×360.
|
|
28
|
+
- `useResizeObserver` et `IResizeState` deviennent génériques (`<T extends Element = HTMLElement>`) pour observer un `SVGSVGElement`. Le défaut est inchangé pour les autres appelants.
|
|
29
|
+
- Seul le chart cartésien est branché. Les textes et les traits s'expriment désormais en px réels (documenté). Les autres charts sont suivis dans #1324.
|
|
30
|
+
- Vérifié : la spec `chart-cartesian-responsive-width.spec.ts`, inscrite dans `GREEN_SPECS`, est rouge sur le parent (écarts de `viewBox` de 229 px et de 36 px) et verte avec le correctif. Le TU SSR passe sans warning (PR #1323).
|
|
31
|
+
- Hors périmètre : le chevauchement des étiquettes d'axe à faible largeur, suivi dans #1325.
|
|
32
|
+
|
|
33
|
+
## [2.37.36] - 2026-11-04
|
|
34
|
+
|
|
35
|
+
### Fixed — Charts : le `<svg>` porte `role="group"` au lieu de `role="img"` (#1318, #1153)
|
|
36
|
+
|
|
37
|
+
`role="img"` rend ses descendants présentationnels. Or les points des charts sont des `role="button"` focusables : axe signalait `nested-interactive`, et un lecteur d'écran pouvait ne jamais annoncer ces points.
|
|
38
|
+
|
|
39
|
+
- Nouvelle constante `CHART_SVG_ROLE = 'group'` (`consts/Chart/chart.const.ts`), appliquée au `<svg>` racine des 20 charts qui ont des points focusables. `OrigamChartGauge` garde `role="img"`, car il n'a aucun point focusable.
|
|
40
|
+
- Le nom accessible (`aria-labelledby`) et la navigation clavier (Tab par point, Entrée / Espace) sont inchangés.
|
|
41
|
+
- Vérifié : nouvelle spec `chart-nested-interactive.spec.ts`, inscrite dans `GREEN_SPECS`, qui balaie 22 stories × 4 Variants. Rouge sur le parent pour 21 stories sur 22, Gauge étant la seule verte ; vert pour les 22 avec le correctif. axe donne 0 `nested-interactive`. TU Chart 537/537 (PR #1326).
|
|
42
|
+
- Limite : un chart reste un arrêt de tabulation par point (de 52 à 504 arrêts). L'ergonomie clavier au niveau du chart n'est pas traitée ici.
|
|
43
|
+
|
|
21
44
|
## [2.37.35] - 2026-11-04
|
|
22
45
|
|
|
23
46
|
### Fixed — `OrigamAlert` / `OrigamBadge` : la visibilité n'est plus lue comme un état hover/active au repos (#1307)
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
class="origam-chart-box-plot__svg origam-chart__svg"
|
|
39
39
|
:class="svgClasses"
|
|
40
40
|
:viewBox="`0 0 ${ SVG_WIDTH } ${ SVG_HEIGHT }`"
|
|
41
|
-
role="
|
|
41
|
+
:role="CHART_SVG_ROLE"
|
|
42
42
|
:aria-label="svgAriaLabel"
|
|
43
43
|
preserveAspectRatio="xMidYMid meet"
|
|
44
44
|
data-cy="origam-chart-box-plot-svg"
|
|
@@ -250,6 +250,7 @@
|
|
|
250
250
|
</template>
|
|
251
251
|
|
|
252
252
|
<script lang="ts" setup>
|
|
253
|
+
import { CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
|
|
253
254
|
import {
|
|
254
255
|
computed,
|
|
255
256
|
ref
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
class="origam-chart-bullet__svg origam-chart__svg"
|
|
39
39
|
:class="svgClasses"
|
|
40
40
|
:viewBox="`0 0 ${ SVG_WIDTH } ${ SVG_HEIGHT }`"
|
|
41
|
-
role="
|
|
41
|
+
:role="CHART_SVG_ROLE"
|
|
42
42
|
:aria-label="svgAriaLabel"
|
|
43
43
|
preserveAspectRatio="xMidYMid meet"
|
|
44
44
|
data-cy="origam-chart-bullet-svg"
|
|
@@ -214,6 +214,7 @@
|
|
|
214
214
|
</template>
|
|
215
215
|
|
|
216
216
|
<script lang="ts" setup>
|
|
217
|
+
import { CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
|
|
217
218
|
import {
|
|
218
219
|
computed,
|
|
219
220
|
ref
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
class="origam-chart-candlestick__svg origam-chart__svg"
|
|
39
39
|
:class="svgClasses"
|
|
40
40
|
:viewBox="`0 0 ${ SVG_WIDTH } ${ SVG_HEIGHT }`"
|
|
41
|
-
role="
|
|
41
|
+
:role="CHART_SVG_ROLE"
|
|
42
42
|
:aria-label="svgAriaLabel"
|
|
43
43
|
preserveAspectRatio="xMidYMid meet"
|
|
44
44
|
data-cy="origam-chart-candlestick-svg"
|
|
@@ -189,6 +189,7 @@
|
|
|
189
189
|
</template>
|
|
190
190
|
|
|
191
191
|
<script lang="ts" setup>
|
|
192
|
+
import { CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
|
|
192
193
|
import {
|
|
193
194
|
computed,
|
|
194
195
|
ref
|
|
@@ -80,11 +80,11 @@
|
|
|
80
80
|
data-cy="origam-chart-cartesian-body"
|
|
81
81
|
>
|
|
82
82
|
<svg
|
|
83
|
-
ref="
|
|
83
|
+
:ref="setSvgRef"
|
|
84
84
|
class="origam-chart-cartesian__svg origam-chart__svg"
|
|
85
85
|
:class="svgClasses"
|
|
86
86
|
:viewBox="viewBox"
|
|
87
|
-
role="
|
|
87
|
+
:role="CHART_SVG_ROLE"
|
|
88
88
|
:aria-label="svgAriaLabel"
|
|
89
89
|
preserveAspectRatio="xMidYMid meet"
|
|
90
90
|
data-cy="origam-chart-cartesian-svg"
|
|
@@ -493,6 +493,7 @@ import {
|
|
|
493
493
|
} from "vue";
|
|
494
494
|
import { useChartHeaderTypography } from "../../composables/Chart/chart-header-typography.composable";
|
|
495
495
|
import { useChartAnimationStyle } from "../../composables/Chart/chart-animation.composable";
|
|
496
|
+
import { useChartSize } from "../../composables/Chart/chart-size.composable";
|
|
496
497
|
import { useBackgroundColor } from "../../composables/Commons/backgroundColor.composable";
|
|
497
498
|
import { useChart } from "../../composables/Chart/chart.composable";
|
|
498
499
|
import { useChartZoom } from "../../composables/Chart/chart-zoom.composable";
|
|
@@ -507,7 +508,7 @@ import {
|
|
|
507
508
|
computePlotBandGeometry,
|
|
508
509
|
computePlotLineGeometry
|
|
509
510
|
} from "../../composables/Chart/chart.composable";
|
|
510
|
-
import { CHART_RANGE_SELECTOR_DEFAULT_BUTTONS } from "../../consts/Chart/chart.const";
|
|
511
|
+
import { CHART_RANGE_SELECTOR_DEFAULT_BUTTONS, CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
|
|
511
512
|
import {
|
|
512
513
|
CHART_ZOOM_RESET_GAP,
|
|
513
514
|
CHART_ZOOM_RESET_MIN_WIDTH,
|
|
@@ -680,11 +681,14 @@ const { paddingClasses, paddingStyles } = usePadding(props);
|
|
|
680
681
|
const { roundedClasses, roundedStyles } = useRounded(props);
|
|
681
682
|
const { headerTypographyStyles } = useChartHeaderTypography(props);
|
|
682
683
|
const chartAnimationStyle = useChartAnimationStyle(props);
|
|
683
|
-
const
|
|
684
|
-
const SVG_HEIGHT = 360;
|
|
684
|
+
const { resizeRef: svgSizeRef, width: svgWidth, height: svgHeight } = useChartSize({ width: 600, height: 360 });
|
|
685
685
|
const PADDING_DEFAULT = { top: 24, right: 24, bottom: 36, left: 48 };
|
|
686
686
|
const PADDING_WITH_SECONDARY_AXIS = { top: 24, right: 56, bottom: 36, left: 48 };
|
|
687
687
|
const svgRef = ref(null);
|
|
688
|
+
const setSvgRef = (el) => {
|
|
689
|
+
svgRef.value = el;
|
|
690
|
+
svgSizeRef.value = el;
|
|
691
|
+
};
|
|
688
692
|
const mousePos = ref({ x: 0, y: 0 });
|
|
689
693
|
const hasSecondaryAxis = computed(
|
|
690
694
|
() => Boolean(props.secondaryYAxis) || activeSeries.value.some((s) => (s.yAxis ?? 0) === 1)
|
|
@@ -786,8 +790,8 @@ const chart = useChart({
|
|
|
786
790
|
smoothing: () => props.smoothing,
|
|
787
791
|
yMin: () => props.yMin,
|
|
788
792
|
yMax: () => props.yMax,
|
|
789
|
-
width: () =>
|
|
790
|
-
height: () =>
|
|
793
|
+
width: () => svgWidth.value,
|
|
794
|
+
height: () => svgHeight.value,
|
|
791
795
|
padding: () => chartPadding.value,
|
|
792
796
|
secondaryYAxis: () => props.secondaryYAxis
|
|
793
797
|
});
|
|
@@ -967,7 +971,7 @@ const svgToCategoryIndex = (clientX) => {
|
|
|
967
971
|
const svgEl = svgRef.value;
|
|
968
972
|
if (!svgEl) return 0;
|
|
969
973
|
const rect = svgEl.getBoundingClientRect();
|
|
970
|
-
const domRatio =
|
|
974
|
+
const domRatio = svgWidth.value / Math.max(1, rect.width);
|
|
971
975
|
const svgX = (clientX - rect.left) * domRatio;
|
|
972
976
|
return pxToCategoryIndex(svgX, plot.value.x0, plot.value.x1);
|
|
973
977
|
};
|
|
@@ -1018,7 +1022,7 @@ const onSvgWheel = (event) => {
|
|
|
1018
1022
|
const svgEl = svgRef.value;
|
|
1019
1023
|
if (!svgEl) return;
|
|
1020
1024
|
const rect = svgEl.getBoundingClientRect();
|
|
1021
|
-
const domRatio =
|
|
1025
|
+
const domRatio = svgWidth.value / Math.max(1, rect.width);
|
|
1022
1026
|
const svgX = (event.clientX - rect.left) * domRatio;
|
|
1023
1027
|
const { x0, x1 } = plot.value;
|
|
1024
1028
|
const plotWidth = Math.max(1, x1 - x0);
|
|
@@ -1039,7 +1043,7 @@ const dragSelectionRect = computed(() => {
|
|
|
1039
1043
|
const svgEl = svgRef.value;
|
|
1040
1044
|
if (!svgEl) return null;
|
|
1041
1045
|
const rect = svgEl.getBoundingClientRect();
|
|
1042
|
-
const domRatio =
|
|
1046
|
+
const domRatio = svgWidth.value / Math.max(1, rect.width);
|
|
1043
1047
|
const startSvgX = (dragStartPx.value - rect.left) * domRatio;
|
|
1044
1048
|
const endSvgX = (dragEndPx.value - rect.left) * domRatio;
|
|
1045
1049
|
const { x0, x1, y0, y1 } = plot.value;
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
class="origam-chart-heatmap__svg origam-chart__svg"
|
|
40
40
|
:class="svgClasses"
|
|
41
41
|
:viewBox="`0 0 ${ svgWidth } ${ svgHeight }`"
|
|
42
|
-
role="
|
|
42
|
+
:role="CHART_SVG_ROLE"
|
|
43
43
|
:aria-label="svgAriaLabel"
|
|
44
44
|
preserveAspectRatio="xMidYMid meet"
|
|
45
45
|
data-cy="origam-chart-heatmap-svg"
|
|
@@ -219,6 +219,7 @@
|
|
|
219
219
|
</template>
|
|
220
220
|
|
|
221
221
|
<script lang="ts" setup>
|
|
222
|
+
import { CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
|
|
222
223
|
import {
|
|
223
224
|
computed,
|
|
224
225
|
ref
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
class="origam-chart-honeycomb__svg origam-chart__svg"
|
|
40
40
|
:class="svgClasses"
|
|
41
41
|
:viewBox="`0 0 ${ svgWidth } ${ svgHeight }`"
|
|
42
|
-
role="
|
|
42
|
+
:role="CHART_SVG_ROLE"
|
|
43
43
|
:aria-label="svgAriaLabel"
|
|
44
44
|
preserveAspectRatio="xMidYMid meet"
|
|
45
45
|
data-cy="origam-chart-honeycomb-svg"
|
|
@@ -144,6 +144,7 @@
|
|
|
144
144
|
</template>
|
|
145
145
|
|
|
146
146
|
<script lang="ts" setup>
|
|
147
|
+
import { CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
|
|
147
148
|
import {
|
|
148
149
|
computed,
|
|
149
150
|
ref
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
class="origam-chart-map__svg origam-chart__svg"
|
|
38
38
|
:class="svgClasses"
|
|
39
39
|
:viewBox="`0 0 ${ SVG_WIDTH } ${ SVG_HEIGHT }`"
|
|
40
|
-
role="
|
|
40
|
+
:role="CHART_SVG_ROLE"
|
|
41
41
|
:aria-label="svgAriaLabel"
|
|
42
42
|
preserveAspectRatio="xMidYMid meet"
|
|
43
43
|
data-cy="origam-chart-map-svg"
|
|
@@ -198,6 +198,7 @@
|
|
|
198
198
|
</template>
|
|
199
199
|
|
|
200
200
|
<script lang="ts" setup>
|
|
201
|
+
import { CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
|
|
201
202
|
import {
|
|
202
203
|
computed,
|
|
203
204
|
ref
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
class="origam-chart-pareto__svg origam-chart__svg"
|
|
39
39
|
:class="svgClasses"
|
|
40
40
|
:viewBox="`0 0 ${ SVG_WIDTH } ${ SVG_HEIGHT }`"
|
|
41
|
-
role="
|
|
41
|
+
:role="CHART_SVG_ROLE"
|
|
42
42
|
:aria-label="svgAriaLabel"
|
|
43
43
|
preserveAspectRatio="xMidYMid meet"
|
|
44
44
|
data-cy="origam-chart-pareto-svg"
|
|
@@ -293,6 +293,7 @@
|
|
|
293
293
|
</template>
|
|
294
294
|
|
|
295
295
|
<script lang="ts" setup>
|
|
296
|
+
import { CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
|
|
296
297
|
import {
|
|
297
298
|
computed,
|
|
298
299
|
ref
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
class="origam-chart-pictorial__svg origam-chart__svg"
|
|
39
39
|
:class="svgClasses"
|
|
40
40
|
:viewBox="`0 0 ${ SVG_WIDTH } ${ SVG_HEIGHT }`"
|
|
41
|
-
role="
|
|
41
|
+
:role="CHART_SVG_ROLE"
|
|
42
42
|
:aria-label="svgAriaLabel"
|
|
43
43
|
preserveAspectRatio="xMidYMid meet"
|
|
44
44
|
data-cy="origam-chart-pictorial-svg"
|
|
@@ -289,6 +289,7 @@
|
|
|
289
289
|
</template>
|
|
290
290
|
|
|
291
291
|
<script lang="ts" setup>
|
|
292
|
+
import { CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
|
|
292
293
|
import {
|
|
293
294
|
computed,
|
|
294
295
|
ref
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
class="origam-chart-polar__svg origam-chart__svg"
|
|
76
76
|
:class="svgClasses"
|
|
77
77
|
:viewBox="viewBox"
|
|
78
|
-
role="
|
|
78
|
+
:role="CHART_SVG_ROLE"
|
|
79
79
|
:aria-label="svgAriaLabel"
|
|
80
80
|
preserveAspectRatio="xMidYMid meet"
|
|
81
81
|
data-cy="origam-chart-polar-svg"
|
|
@@ -161,6 +161,7 @@
|
|
|
161
161
|
</template>
|
|
162
162
|
|
|
163
163
|
<script lang="ts" setup>
|
|
164
|
+
import { CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
|
|
164
165
|
import {
|
|
165
166
|
computed,
|
|
166
167
|
ref
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
class="origam-chart-polar-bar__svg origam-chart__svg"
|
|
39
39
|
:class="svgClasses"
|
|
40
40
|
:viewBox="`0 0 ${ SVG_SIZE } ${ SVG_SIZE }`"
|
|
41
|
-
role="
|
|
41
|
+
:role="CHART_SVG_ROLE"
|
|
42
42
|
:aria-label="svgAriaLabel"
|
|
43
43
|
preserveAspectRatio="xMidYMid meet"
|
|
44
44
|
data-cy="origam-chart-polar-bar-svg"
|
|
@@ -154,6 +154,7 @@
|
|
|
154
154
|
</template>
|
|
155
155
|
|
|
156
156
|
<script lang="ts" setup>
|
|
157
|
+
import { CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
|
|
157
158
|
import {
|
|
158
159
|
computed,
|
|
159
160
|
ref
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
class="origam-chart-pyramid__svg origam-chart__svg"
|
|
39
39
|
:class="svgClasses"
|
|
40
40
|
:viewBox="`0 0 ${ SVG_WIDTH } ${ SVG_HEIGHT }`"
|
|
41
|
-
role="
|
|
41
|
+
:role="CHART_SVG_ROLE"
|
|
42
42
|
:aria-label="svgAriaLabel"
|
|
43
43
|
preserveAspectRatio="xMidYMid meet"
|
|
44
44
|
data-cy="origam-chart-pyramid-svg"
|
|
@@ -153,6 +153,7 @@
|
|
|
153
153
|
</template>
|
|
154
154
|
|
|
155
155
|
<script lang="ts" setup>
|
|
156
|
+
import { CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
|
|
156
157
|
import {
|
|
157
158
|
computed,
|
|
158
159
|
ref
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
class="origam-chart-radar__svg origam-chart__svg"
|
|
39
39
|
:class="svgClasses"
|
|
40
40
|
:viewBox="viewBox"
|
|
41
|
-
role="
|
|
41
|
+
:role="CHART_SVG_ROLE"
|
|
42
42
|
:aria-label="svgAriaLabel"
|
|
43
43
|
preserveAspectRatio="xMidYMid meet"
|
|
44
44
|
data-cy="origam-chart-radar-svg"
|
|
@@ -142,6 +142,7 @@
|
|
|
142
142
|
</template>
|
|
143
143
|
|
|
144
144
|
<script lang="ts" setup>
|
|
145
|
+
import { CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
|
|
145
146
|
import {
|
|
146
147
|
computed,
|
|
147
148
|
ref
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
class="origam-chart-sankey__svg origam-chart__svg"
|
|
39
39
|
:class="svgClasses"
|
|
40
40
|
:viewBox="`0 0 ${ SVG_WIDTH } ${ SVG_HEIGHT }`"
|
|
41
|
-
role="
|
|
41
|
+
:role="CHART_SVG_ROLE"
|
|
42
42
|
:aria-label="svgAriaLabel"
|
|
43
43
|
preserveAspectRatio="xMidYMid meet"
|
|
44
44
|
data-cy="origam-chart-sankey-svg"
|
|
@@ -166,6 +166,7 @@
|
|
|
166
166
|
</template>
|
|
167
167
|
|
|
168
168
|
<script lang="ts" setup>
|
|
169
|
+
import { CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
|
|
169
170
|
import {
|
|
170
171
|
computed,
|
|
171
172
|
ref
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
ref="svgRef"
|
|
12
12
|
class="origam-chart-sparkline__svg"
|
|
13
13
|
:viewBox="`0 0 ${ SVG_WIDTH } ${ SVG_HEIGHT }`"
|
|
14
|
-
role="
|
|
14
|
+
:role="CHART_SVG_ROLE"
|
|
15
15
|
:aria-label="svgAriaLabel"
|
|
16
16
|
preserveAspectRatio="none"
|
|
17
17
|
data-cy="origam-chart-sparkline-svg"
|
|
@@ -158,6 +158,7 @@
|
|
|
158
158
|
</template>
|
|
159
159
|
|
|
160
160
|
<script lang="ts" setup>
|
|
161
|
+
import { CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
|
|
161
162
|
import {
|
|
162
163
|
computed,
|
|
163
164
|
ref
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
class="origam-chart-streamgraph__svg origam-chart__svg"
|
|
39
39
|
:class="svgClasses"
|
|
40
40
|
:viewBox="`0 0 ${ SVG_WIDTH } ${ SVG_HEIGHT }`"
|
|
41
|
-
role="
|
|
41
|
+
:role="CHART_SVG_ROLE"
|
|
42
42
|
:aria-label="svgAriaLabel"
|
|
43
43
|
preserveAspectRatio="xMidYMid meet"
|
|
44
44
|
data-cy="origam-chart-streamgraph-svg"
|
|
@@ -177,6 +177,7 @@
|
|
|
177
177
|
</template>
|
|
178
178
|
|
|
179
179
|
<script lang="ts" setup>
|
|
180
|
+
import { CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
|
|
180
181
|
import {
|
|
181
182
|
computed,
|
|
182
183
|
ref
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
class="origam-chart-sunburst__svg origam-chart__svg"
|
|
39
39
|
:class="svgClasses"
|
|
40
40
|
:viewBox="`0 0 ${ SVG_SIZE } ${ SVG_SIZE }`"
|
|
41
|
-
role="
|
|
41
|
+
:role="CHART_SVG_ROLE"
|
|
42
42
|
:aria-label="svgAriaLabel"
|
|
43
43
|
preserveAspectRatio="xMidYMid meet"
|
|
44
44
|
data-cy="origam-chart-sunburst-svg"
|
|
@@ -162,6 +162,7 @@
|
|
|
162
162
|
</template>
|
|
163
163
|
|
|
164
164
|
<script lang="ts" setup>
|
|
165
|
+
import { CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
|
|
165
166
|
import {
|
|
166
167
|
computed,
|
|
167
168
|
ref
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
class="origam-chart-treemap__svg origam-chart__svg"
|
|
39
39
|
:class="svgClasses"
|
|
40
40
|
:viewBox="`0 0 ${ SVG_WIDTH } ${ SVG_HEIGHT }`"
|
|
41
|
-
role="
|
|
41
|
+
:role="CHART_SVG_ROLE"
|
|
42
42
|
:aria-label="svgAriaLabel"
|
|
43
43
|
preserveAspectRatio="xMidYMid meet"
|
|
44
44
|
data-cy="origam-chart-treemap-svg"
|
|
@@ -158,6 +158,7 @@
|
|
|
158
158
|
</template>
|
|
159
159
|
|
|
160
160
|
<script lang="ts" setup>
|
|
161
|
+
import { CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
|
|
161
162
|
import {
|
|
162
163
|
computed,
|
|
163
164
|
ref
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
class="origam-chart-variwide__svg origam-chart__svg"
|
|
39
39
|
:class="svgClasses"
|
|
40
40
|
:viewBox="`0 0 ${ SVG_WIDTH } ${ SVG_HEIGHT }`"
|
|
41
|
-
role="
|
|
41
|
+
:role="CHART_SVG_ROLE"
|
|
42
42
|
:aria-label="svgAriaLabel"
|
|
43
43
|
preserveAspectRatio="xMidYMid meet"
|
|
44
44
|
data-cy="origam-chart-variwide-svg"
|
|
@@ -233,6 +233,7 @@
|
|
|
233
233
|
</template>
|
|
234
234
|
|
|
235
235
|
<script lang="ts" setup>
|
|
236
|
+
import { CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
|
|
236
237
|
import {
|
|
237
238
|
computed,
|
|
238
239
|
ref
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
class="origam-chart-word-cloud__svg origam-chart__svg"
|
|
39
39
|
:class="svgClasses"
|
|
40
40
|
:viewBox="`0 0 ${ SVG_WIDTH } ${ SVG_HEIGHT }`"
|
|
41
|
-
role="
|
|
41
|
+
:role="CHART_SVG_ROLE"
|
|
42
42
|
:aria-label="svgAriaLabel"
|
|
43
43
|
preserveAspectRatio="xMidYMid meet"
|
|
44
44
|
data-cy="origam-chart-word-cloud-svg"
|
|
@@ -131,6 +131,7 @@
|
|
|
131
131
|
</template>
|
|
132
132
|
|
|
133
133
|
<script lang="ts" setup>
|
|
134
|
+
import { CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
|
|
134
135
|
import {
|
|
135
136
|
computed,
|
|
136
137
|
ref
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useChartSize = useChartSize;
|
|
7
|
+
var _vue = require("vue");
|
|
8
|
+
var _resizeObserver = require("../Commons/resizeObserver.composable.cjs");
|
|
9
|
+
function useChartSize(fallback) {
|
|
10
|
+
const {
|
|
11
|
+
resizeRef,
|
|
12
|
+
contentRect
|
|
13
|
+
} = (0, _resizeObserver.useResizeObserver)();
|
|
14
|
+
const width = (0, _vue.computed)(() => contentRect.value?.width || fallback.width);
|
|
15
|
+
const height = (0, _vue.computed)(() => contentRect.value?.height || fallback.height);
|
|
16
|
+
return {
|
|
17
|
+
resizeRef,
|
|
18
|
+
width,
|
|
19
|
+
height
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*********************************************************
|
|
2
|
+
* useChartSize
|
|
3
|
+
*
|
|
4
|
+
* @description
|
|
5
|
+
* Dimensions de la surface de dessin d'un chart (#1317) : la boite
|
|
6
|
+
* rendue de l'element portant `resizeRef`, afin que `viewBox` suive le
|
|
7
|
+
* conteneur au lieu d'une constante. Tant que rien n'est mesure (SSR,
|
|
8
|
+
* avant montage, boite nulle) on rend `fallback`, identique entre
|
|
9
|
+
* serveur et premier rendu client — pas de mismatch d'hydratation.
|
|
10
|
+
********************************************************/
|
|
11
|
+
export declare function useChartSize(fallback: {
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
}): {
|
|
15
|
+
resizeRef: import("vue").Ref<SVGSVGElement | null | undefined, SVGSVGElement | null | undefined>;
|
|
16
|
+
width: import("vue").ComputedRef<number>;
|
|
17
|
+
height: import("vue").ComputedRef<number>;
|
|
18
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
import { useResizeObserver } from "../Commons/resizeObserver.composable.js";
|
|
3
|
+
export function useChartSize(fallback) {
|
|
4
|
+
const { resizeRef, contentRect } = useResizeObserver();
|
|
5
|
+
const width = computed(() => contentRect.value?.width || fallback.width);
|
|
6
|
+
const height = computed(() => contentRect.value?.height || fallback.height);
|
|
7
|
+
return { resizeRef, width, height };
|
|
8
|
+
}
|
|
@@ -14,4 +14,4 @@ import type { IResizeState } from '../../interfaces/Commons/resizeObserver.inter
|
|
|
14
14
|
* `contentRect` reste `undefined` en permanence, silencieusement, meme
|
|
15
15
|
* comportement de garde que `useIntersectionObserver`.
|
|
16
16
|
********************************************************/
|
|
17
|
-
export declare function useResizeObserver(callback?: ResizeObserverCallback, box?: 'content' | 'border'): IResizeState
|
|
17
|
+
export declare function useResizeObserver<T extends Element = HTMLElement>(callback?: ResizeObserverCallback, box?: 'content' | 'border'): IResizeState<T>;
|
|
@@ -1680,4 +1680,16 @@ Object.keys(_chartZoom).forEach(function (key) {
|
|
|
1680
1680
|
return _chartZoom[key];
|
|
1681
1681
|
}
|
|
1682
1682
|
});
|
|
1683
|
+
});
|
|
1684
|
+
var _chartSize = require("./Chart/chart-size.composable.cjs");
|
|
1685
|
+
Object.keys(_chartSize).forEach(function (key) {
|
|
1686
|
+
if (key === "default" || key === "__esModule") return;
|
|
1687
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
1688
|
+
if (key in exports && exports[key] === _chartSize[key]) return;
|
|
1689
|
+
Object.defineProperty(exports, key, {
|
|
1690
|
+
enumerable: true,
|
|
1691
|
+
get: function () {
|
|
1692
|
+
return _chartSize[key];
|
|
1693
|
+
}
|
|
1694
|
+
});
|
|
1683
1695
|
});
|
|
@@ -138,3 +138,4 @@ export * from "./Chart/chart.composable.js";
|
|
|
138
138
|
export * from "./Chart/chart-animation.composable.js";
|
|
139
139
|
export * from "./Chart/chart-header-typography.composable.js";
|
|
140
140
|
export * from "./Chart/chart-zoom.composable.js";
|
|
141
|
+
export * from "./Chart/chart-size.composable.js";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.CHART_Y_TICK_COUNT = exports.CHART_TICK_LABEL_PRECISION_FACTOR = exports.CHART_SLICE_LABEL_PREFIX = exports.CHART_SCATTER_MIN_RADIUS = exports.CHART_SCATTER_MAX_RADIUS = exports.CHART_SCATTER_DEFAULT_RADIUS = exports.CHART_RANGE_SELECTOR_DEFAULT_BUTTONS = exports.CHART_RADAR_RADIUS_INSET = exports.CHART_RADAR_MIN_RADIUS = exports.CHART_RADAR_MARKER_RADIUS = exports.CHART_POINT_MARKER_RADIUS = exports.CHART_PLOT_LINE_LABEL_TOP_OFFSET = exports.CHART_PLOT_LINE_LABEL_OFFSET = exports.CHART_PLOT_LINE_DEFAULT_WIDTH = exports.CHART_PLOT_BAND_DEFAULT_OPACITY = exports.CHART_PIE_RADIUS_INSET = exports.CHART_PIE_MIN_RADIUS = exports.CHART_PERCENT_TICK_STEP = exports.CHART_PERCENT_MIN = exports.CHART_PERCENT_MAX = exports.CHART_NICE_STEP_LADDER = exports.CHART_EPSILON = exports.CHART_DEFAULT_PALETTE = exports.CHART_DASH_ARRAY_SOLID = exports.CHART_DASH_ARRAY_DOTTED = exports.CHART_DASH_ARRAY_DASHED = exports.CHART_COLOR_FALLBACK = exports.CHART_BAR_SLOT_FILL_RATIO = exports.CHART_ANNOTATION_LABEL_PADDING = exports.CHART_ANNOTATION_LABEL_MIN_WIDTH = exports.CHART_ANNOTATION_LABEL_HEIGHT = exports.CHART_ANNOTATION_LABEL_CHAR_WIDTH = exports.CHART_ANNOTATION_DEFAULT_WIDTH = exports.CHART_ANNOTATION_DEFAULT_RADIUS = exports.CHART_ANNOTATION_DEFAULT_DY = exports.CHART_ANNOTATION_ARROWHEAD_WIDTH_FACTOR = exports.CHART_ANNOTATION_ARROWHEAD_SPREAD = exports.CHART_ANNOTATION_ARROWHEAD_PRECISION = exports.CHART_ANNOTATION_ARROWHEAD_MIN_SIZE = exports.CHART_ANIMATION_DURATION_DEFAULT = void 0;
|
|
6
|
+
exports.CHART_Y_TICK_COUNT = exports.CHART_TICK_LABEL_PRECISION_FACTOR = exports.CHART_SVG_ROLE = exports.CHART_SLICE_LABEL_PREFIX = exports.CHART_SCATTER_MIN_RADIUS = exports.CHART_SCATTER_MAX_RADIUS = exports.CHART_SCATTER_DEFAULT_RADIUS = exports.CHART_RANGE_SELECTOR_DEFAULT_BUTTONS = exports.CHART_RADAR_RADIUS_INSET = exports.CHART_RADAR_MIN_RADIUS = exports.CHART_RADAR_MARKER_RADIUS = exports.CHART_POINT_MARKER_RADIUS = exports.CHART_PLOT_LINE_LABEL_TOP_OFFSET = exports.CHART_PLOT_LINE_LABEL_OFFSET = exports.CHART_PLOT_LINE_DEFAULT_WIDTH = exports.CHART_PLOT_BAND_DEFAULT_OPACITY = exports.CHART_PIE_RADIUS_INSET = exports.CHART_PIE_MIN_RADIUS = exports.CHART_PERCENT_TICK_STEP = exports.CHART_PERCENT_MIN = exports.CHART_PERCENT_MAX = exports.CHART_NICE_STEP_LADDER = exports.CHART_EPSILON = exports.CHART_DEFAULT_PALETTE = exports.CHART_DASH_ARRAY_SOLID = exports.CHART_DASH_ARRAY_DOTTED = exports.CHART_DASH_ARRAY_DASHED = exports.CHART_COLOR_FALLBACK = exports.CHART_BAR_SLOT_FILL_RATIO = exports.CHART_ANNOTATION_LABEL_PADDING = exports.CHART_ANNOTATION_LABEL_MIN_WIDTH = exports.CHART_ANNOTATION_LABEL_HEIGHT = exports.CHART_ANNOTATION_LABEL_CHAR_WIDTH = exports.CHART_ANNOTATION_DEFAULT_WIDTH = exports.CHART_ANNOTATION_DEFAULT_RADIUS = exports.CHART_ANNOTATION_DEFAULT_DY = exports.CHART_ANNOTATION_ARROWHEAD_WIDTH_FACTOR = exports.CHART_ANNOTATION_ARROWHEAD_SPREAD = exports.CHART_ANNOTATION_ARROWHEAD_PRECISION = exports.CHART_ANNOTATION_ARROWHEAD_MIN_SIZE = exports.CHART_ANIMATION_DURATION_DEFAULT = void 0;
|
|
7
7
|
var _intent = require("../../enums/Commons/intent.enum.cjs");
|
|
8
8
|
const CHART_Y_TICK_COUNT = exports.CHART_Y_TICK_COUNT = 5;
|
|
9
9
|
const CHART_ANIMATION_DURATION_DEFAULT = exports.CHART_ANIMATION_DURATION_DEFAULT = 600;
|
|
@@ -74,4 +74,5 @@ const CHART_RADAR_RADIUS_INSET = exports.CHART_RADAR_RADIUS_INSET = 8;
|
|
|
74
74
|
const CHART_SCATTER_DEFAULT_RADIUS = exports.CHART_SCATTER_DEFAULT_RADIUS = 5;
|
|
75
75
|
const CHART_SCATTER_MIN_RADIUS = exports.CHART_SCATTER_MIN_RADIUS = 5;
|
|
76
76
|
const CHART_SCATTER_MAX_RADIUS = exports.CHART_SCATTER_MAX_RADIUS = 36;
|
|
77
|
-
const CHART_SLICE_LABEL_PREFIX = exports.CHART_SLICE_LABEL_PREFIX = "Slice";
|
|
77
|
+
const CHART_SLICE_LABEL_PREFIX = exports.CHART_SLICE_LABEL_PREFIX = "Slice";
|
|
78
|
+
const CHART_SVG_ROLE = exports.CHART_SVG_ROLE = "group";
|
|
@@ -255,3 +255,16 @@ export declare const CHART_SCATTER_MAX_RADIUS = 36;
|
|
|
255
255
|
* base 1.
|
|
256
256
|
********************************************************/
|
|
257
257
|
export declare const CHART_SLICE_LABEL_PREFIX = "Slice";
|
|
258
|
+
/*********************************************************
|
|
259
|
+
* CHART_SVG_ROLE
|
|
260
|
+
*
|
|
261
|
+
* @description
|
|
262
|
+
* Role of the root `<svg>` of every chart whose data points are focusable
|
|
263
|
+
* (`role="button"` + `tabindex="0"`). It is `group`, never `img`: an `img`
|
|
264
|
+
* renders its subtree presentational, so a screen reader announces only the
|
|
265
|
+
* picture while the keyboard stops on each point (axe `nested-interactive`,
|
|
266
|
+
* WCAG 4.1.2, #1318 and #1153).
|
|
267
|
+
* A named `group` keeps the accessible name (`aria-label`) and lets the
|
|
268
|
+
* focusable points be announced.
|
|
269
|
+
********************************************************/
|
|
270
|
+
export declare const CHART_SVG_ROLE = "group";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DeepReadonly, Ref } from 'vue';
|
|
2
|
-
export interface IResizeState {
|
|
3
|
-
resizeRef: Ref<
|
|
2
|
+
export interface IResizeState<T extends Element = HTMLElement> {
|
|
3
|
+
resizeRef: Ref<T | null | undefined>;
|
|
4
4
|
contentRect: DeepReadonly<Ref<DOMRectReadOnly | undefined>>;
|
|
5
5
|
}
|