origam 2.37.36 → 2.37.38
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 +28 -0
- package/dist/src/components/Chart/OrigamChartBoxPlot.vue +6 -7
- package/dist/src/components/Chart/OrigamChartBullet.vue +7 -8
- package/dist/src/components/Chart/OrigamChartCandlestick.vue +10 -11
- package/dist/src/components/Chart/OrigamChartCartesian.vue +12 -8
- package/dist/src/components/Chart/OrigamChartGauge.vue +8 -6
- package/dist/src/components/Chart/OrigamChartHeatmap.vue +9 -5
- package/dist/src/components/Chart/OrigamChartMap.vue +14 -15
- package/dist/src/components/Chart/OrigamChartPareto.vue +9 -10
- package/dist/src/components/Chart/OrigamChartPictorial.vue +10 -11
- package/dist/src/components/Chart/OrigamChartPolar.vue +6 -7
- package/dist/src/components/Chart/OrigamChartPolarBar.vue +8 -8
- package/dist/src/components/Chart/OrigamChartPyramid.vue +6 -7
- package/dist/src/components/Chart/OrigamChartRadar.vue +7 -9
- package/dist/src/components/Chart/OrigamChartSankey.vue +6 -7
- package/dist/src/components/Chart/OrigamChartSparkline.vue +15 -17
- package/dist/src/components/Chart/OrigamChartStreamgraph.vue +9 -10
- package/dist/src/components/Chart/OrigamChartSunburst.vue +8 -8
- package/dist/src/components/Chart/OrigamChartTreemap.vue +6 -7
- package/dist/src/components/Chart/OrigamChartVariwide.vue +8 -9
- package/dist/src/components/Chart/OrigamChartWordCloud.vue +16 -13
- package/dist/src/composables/Chart/chart-size.composable.cjs +26 -0
- package/dist/src/composables/Chart/chart-size.composable.d.ts +27 -0
- package/dist/src/composables/Chart/chart-size.composable.js +13 -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 +81 -2
- package/dist/src/consts/Chart/chart.const.d.ts +100 -0
- package/dist/src/consts/Chart/chart.const.js +25 -0
- package/dist/src/interfaces/Commons/resizeObserver.interface.d.ts +2 -2
- package/package.json +1 -1
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
ref="svgRef"
|
|
38
38
|
class="origam-chart-word-cloud__svg origam-chart__svg"
|
|
39
39
|
:class="svgClasses"
|
|
40
|
-
:viewBox="`0 0 ${
|
|
40
|
+
:viewBox="`0 0 ${ svgWidth } ${ svgHeight }`"
|
|
41
41
|
:role="CHART_SVG_ROLE"
|
|
42
42
|
:aria-label="svgAriaLabel"
|
|
43
43
|
preserveAspectRatio="xMidYMid meet"
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
</template>
|
|
132
132
|
|
|
133
133
|
<script lang="ts" setup>
|
|
134
|
-
import { CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
|
|
134
|
+
import { CHART_SIZE_FALLBACK, CHART_SVG_ROLE } from "../../consts/Chart/chart.const";
|
|
135
135
|
import {
|
|
136
136
|
computed,
|
|
137
137
|
ref
|
|
@@ -139,6 +139,7 @@ import {
|
|
|
139
139
|
import OrigamChartLegend from "./OrigamChartLegend.vue";
|
|
140
140
|
import OrigamChartTooltip from "./OrigamChartTooltip.vue";
|
|
141
141
|
import { useUnsupportedProp } from "../../composables/Commons/unsupportedProp.composable";
|
|
142
|
+
import { useChartSize } from "../../composables/Chart/chart-size.composable";
|
|
142
143
|
import { useChartAnimationStyle } from "../../composables/Chart/chart-animation.composable";
|
|
143
144
|
import { useChartHeaderTypography } from "../../composables/Chart/chart-header-typography.composable";
|
|
144
145
|
import { useBackgroundColor } from "../../composables/Commons/backgroundColor.composable";
|
|
@@ -235,10 +236,13 @@ const { headerTypographyStyles } = useChartHeaderTypography({
|
|
|
235
236
|
return props.fontSize;
|
|
236
237
|
}
|
|
237
238
|
});
|
|
238
|
-
const
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
|
|
239
|
+
const { resizeRef: svgRef, width: svgWidth, height: svgHeight } = useChartSize(CHART_SIZE_FALLBACK.wordCloud);
|
|
240
|
+
const fontScale = computed(() => Math.min(
|
|
241
|
+
svgWidth.value / CHART_SIZE_FALLBACK.wordCloud.width,
|
|
242
|
+
svgHeight.value / CHART_SIZE_FALLBACK.wordCloud.height
|
|
243
|
+
));
|
|
244
|
+
const centerX = computed(() => svgWidth.value / 2);
|
|
245
|
+
const centerY = computed(() => svgHeight.value / 2);
|
|
242
246
|
const SPIRAL_STEP = 0.15;
|
|
243
247
|
const SPIRAL_A = 4;
|
|
244
248
|
const MAX_SPIRAL_ITERATIONS = 1e3;
|
|
@@ -302,7 +306,7 @@ const placedWords = computed(() => {
|
|
|
302
306
|
const result = [];
|
|
303
307
|
const placed = [];
|
|
304
308
|
sorted.forEach((datum, idx) => {
|
|
305
|
-
const fontSize = props.minFontSize + datum.value / maxVal * (props.maxFontSize - props.minFontSize);
|
|
309
|
+
const fontSize = (props.minFontSize + datum.value / maxVal * (props.maxFontSize - props.minFontSize)) * fontScale.value;
|
|
306
310
|
const angle = angleFor(idx);
|
|
307
311
|
const isVertical = angle !== 0 && Math.abs(angle) === 90;
|
|
308
312
|
const estimatedW = datum.text.length * fontSize * WORD_WIDTH_FACTOR;
|
|
@@ -310,8 +314,8 @@ const placedWords = computed(() => {
|
|
|
310
314
|
const wordW = isVertical ? estimatedH : estimatedW;
|
|
311
315
|
const wordH = isVertical ? estimatedW : estimatedH;
|
|
312
316
|
const color = colorFor(idx);
|
|
313
|
-
let cx =
|
|
314
|
-
let cy =
|
|
317
|
+
let cx = centerX.value;
|
|
318
|
+
let cy = centerY.value;
|
|
315
319
|
let placed_ = false;
|
|
316
320
|
if (placed.length === 0) {
|
|
317
321
|
placed_ = true;
|
|
@@ -319,9 +323,9 @@ const placedWords = computed(() => {
|
|
|
319
323
|
let theta = 0;
|
|
320
324
|
for (let iter = 0; iter < MAX_SPIRAL_ITERATIONS; iter++) {
|
|
321
325
|
const r = SPIRAL_A * theta;
|
|
322
|
-
cx =
|
|
323
|
-
cy =
|
|
324
|
-
if (cx < wordW / 2 || cx >
|
|
326
|
+
cx = centerX.value + r * Math.cos(theta);
|
|
327
|
+
cy = centerY.value + r * Math.sin(theta);
|
|
328
|
+
if (cx < wordW / 2 || cx > svgWidth.value - wordW / 2 || cy < wordH / 2 || cy > svgHeight.value - wordH / 2) {
|
|
325
329
|
theta += SPIRAL_STEP;
|
|
326
330
|
continue;
|
|
327
331
|
}
|
|
@@ -375,7 +379,6 @@ const legendItems = computed(() => {
|
|
|
375
379
|
visible: true
|
|
376
380
|
}));
|
|
377
381
|
});
|
|
378
|
-
const svgRef = ref(null);
|
|
379
382
|
const mousePos = ref({ x: 0, y: 0 });
|
|
380
383
|
const hoveredIndex = ref(null);
|
|
381
384
|
const hoveredWord = computed(() => {
|
|
@@ -0,0 +1,26 @@
|
|
|
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, options = {}) {
|
|
10
|
+
const {
|
|
11
|
+
resizeRef,
|
|
12
|
+
contentRect
|
|
13
|
+
} = (0, _resizeObserver.useResizeObserver)();
|
|
14
|
+
const measuredWidth = (0, _vue.computed)(() => contentRect.value?.width || fallback.width);
|
|
15
|
+
const measuredHeight = (0, _vue.computed)(() => contentRect.value?.height || fallback.height);
|
|
16
|
+
const width = (0, _vue.computed)(() => {
|
|
17
|
+
const ratio = options.aspectRatio;
|
|
18
|
+
return ratio ? Math.min(measuredWidth.value, measuredHeight.value / ratio) : measuredWidth.value;
|
|
19
|
+
});
|
|
20
|
+
const height = (0, _vue.computed)(() => options.aspectRatio ? width.value * options.aspectRatio : measuredHeight.value);
|
|
21
|
+
return {
|
|
22
|
+
resizeRef,
|
|
23
|
+
width,
|
|
24
|
+
height
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
* @description
|
|
12
|
+
* `aspectRatio` (#1324, hauteur / largeur) est le mode des charts a
|
|
13
|
+
* geometrie non deformable (radiaux : `1`, jauge, carte) : la surface a
|
|
14
|
+
* ce rapport exact, sa largeur suit le conteneur et une hauteur imposee
|
|
15
|
+
* (prop `height`) la plafonne — le cercle ou la carte n'est jamais
|
|
16
|
+
* ecrase.
|
|
17
|
+
********************************************************/
|
|
18
|
+
export declare function useChartSize(fallback: {
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
}, options?: {
|
|
22
|
+
aspectRatio?: number;
|
|
23
|
+
}): {
|
|
24
|
+
resizeRef: import("vue").Ref<SVGSVGElement | null | undefined, SVGSVGElement | null | undefined>;
|
|
25
|
+
width: import("vue").ComputedRef<number>;
|
|
26
|
+
height: import("vue").ComputedRef<number>;
|
|
27
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
import { useResizeObserver } from "../Commons/resizeObserver.composable.js";
|
|
3
|
+
export function useChartSize(fallback, options = {}) {
|
|
4
|
+
const { resizeRef, contentRect } = useResizeObserver();
|
|
5
|
+
const measuredWidth = computed(() => contentRect.value?.width || fallback.width);
|
|
6
|
+
const measuredHeight = computed(() => contentRect.value?.height || fallback.height);
|
|
7
|
+
const width = computed(() => {
|
|
8
|
+
const ratio = options.aspectRatio;
|
|
9
|
+
return ratio ? Math.min(measuredWidth.value, measuredHeight.value / ratio) : measuredWidth.value;
|
|
10
|
+
});
|
|
11
|
+
const height = computed(() => options.aspectRatio ? width.value * options.aspectRatio : measuredHeight.value);
|
|
12
|
+
return { resizeRef, width, height };
|
|
13
|
+
}
|
|
@@ -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_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;
|
|
6
|
+
exports.CHART_Y_TICK_COUNT = exports.CHART_TICK_LABEL_PRECISION_FACTOR = exports.CHART_SVG_ROLE = exports.CHART_SLICE_LABEL_PREFIX = exports.CHART_SIZE_FALLBACK = 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_ASPECT_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;
|
|
@@ -75,4 +75,83 @@ 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
77
|
const CHART_SLICE_LABEL_PREFIX = exports.CHART_SLICE_LABEL_PREFIX = "Slice";
|
|
78
|
-
const CHART_SVG_ROLE = exports.CHART_SVG_ROLE = "group";
|
|
78
|
+
const CHART_SVG_ROLE = exports.CHART_SVG_ROLE = "group";
|
|
79
|
+
const CHART_SIZE_FALLBACK = exports.CHART_SIZE_FALLBACK = {
|
|
80
|
+
boxPlot: {
|
|
81
|
+
width: 600,
|
|
82
|
+
height: 400
|
|
83
|
+
},
|
|
84
|
+
bullet: {
|
|
85
|
+
width: 600,
|
|
86
|
+
height: 400
|
|
87
|
+
},
|
|
88
|
+
candlestick: {
|
|
89
|
+
width: 600,
|
|
90
|
+
height: 400
|
|
91
|
+
},
|
|
92
|
+
pareto: {
|
|
93
|
+
width: 640,
|
|
94
|
+
height: 400
|
|
95
|
+
},
|
|
96
|
+
pictorial: {
|
|
97
|
+
width: 600,
|
|
98
|
+
height: 400
|
|
99
|
+
},
|
|
100
|
+
pyramid: {
|
|
101
|
+
width: 600,
|
|
102
|
+
height: 400
|
|
103
|
+
},
|
|
104
|
+
sankey: {
|
|
105
|
+
width: 600,
|
|
106
|
+
height: 400
|
|
107
|
+
},
|
|
108
|
+
streamgraph: {
|
|
109
|
+
width: 700,
|
|
110
|
+
height: 420
|
|
111
|
+
},
|
|
112
|
+
treemap: {
|
|
113
|
+
width: 600,
|
|
114
|
+
height: 400
|
|
115
|
+
},
|
|
116
|
+
variwide: {
|
|
117
|
+
width: 600,
|
|
118
|
+
height: 400
|
|
119
|
+
},
|
|
120
|
+
wordCloud: {
|
|
121
|
+
width: 800,
|
|
122
|
+
height: 500
|
|
123
|
+
},
|
|
124
|
+
gauge: {
|
|
125
|
+
width: 360,
|
|
126
|
+
height: 280
|
|
127
|
+
},
|
|
128
|
+
map: {
|
|
129
|
+
width: 1e3,
|
|
130
|
+
height: 500
|
|
131
|
+
},
|
|
132
|
+
sparkline: {
|
|
133
|
+
width: 120,
|
|
134
|
+
height: 30
|
|
135
|
+
},
|
|
136
|
+
polar: {
|
|
137
|
+
width: 360,
|
|
138
|
+
height: 360
|
|
139
|
+
},
|
|
140
|
+
polarBar: {
|
|
141
|
+
width: 400,
|
|
142
|
+
height: 400
|
|
143
|
+
},
|
|
144
|
+
radar: {
|
|
145
|
+
width: 360,
|
|
146
|
+
height: 360
|
|
147
|
+
},
|
|
148
|
+
sunburst: {
|
|
149
|
+
width: 400,
|
|
150
|
+
height: 400
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
const CHART_ASPECT_RATIO = exports.CHART_ASPECT_RATIO = {
|
|
154
|
+
radial: 1,
|
|
155
|
+
gauge: 280 / 360,
|
|
156
|
+
map: 0.5
|
|
157
|
+
};
|
|
@@ -268,3 +268,103 @@ export declare const CHART_SLICE_LABEL_PREFIX = "Slice";
|
|
|
268
268
|
* focusable points be announced.
|
|
269
269
|
********************************************************/
|
|
270
270
|
export declare const CHART_SVG_ROLE = "group";
|
|
271
|
+
/*********************************************************
|
|
272
|
+
* CHART_SIZE_FALLBACK (#1324)
|
|
273
|
+
*
|
|
274
|
+
* @description
|
|
275
|
+
* Taille de la surface de dessin d'un chart tant que rien n'est mesure
|
|
276
|
+
* (SSR, avant montage, boite nulle) : c'est l'ancien `viewBox` fige,
|
|
277
|
+
* conserve comme repli pour que le premier rendu serveur et client
|
|
278
|
+
* restent identiques. Une fois la boite du conteneur mesuree
|
|
279
|
+
* (`useChartSize`), ces valeurs ne servent plus.
|
|
280
|
+
* Les charts a rapport impose (`CHART_ASPECT_RATIO`) gardent un repli
|
|
281
|
+
* a ce meme rapport.
|
|
282
|
+
********************************************************/
|
|
283
|
+
export declare const CHART_SIZE_FALLBACK: {
|
|
284
|
+
readonly boxPlot: {
|
|
285
|
+
readonly width: 600;
|
|
286
|
+
readonly height: 400;
|
|
287
|
+
};
|
|
288
|
+
readonly bullet: {
|
|
289
|
+
readonly width: 600;
|
|
290
|
+
readonly height: 400;
|
|
291
|
+
};
|
|
292
|
+
readonly candlestick: {
|
|
293
|
+
readonly width: 600;
|
|
294
|
+
readonly height: 400;
|
|
295
|
+
};
|
|
296
|
+
readonly pareto: {
|
|
297
|
+
readonly width: 640;
|
|
298
|
+
readonly height: 400;
|
|
299
|
+
};
|
|
300
|
+
readonly pictorial: {
|
|
301
|
+
readonly width: 600;
|
|
302
|
+
readonly height: 400;
|
|
303
|
+
};
|
|
304
|
+
readonly pyramid: {
|
|
305
|
+
readonly width: 600;
|
|
306
|
+
readonly height: 400;
|
|
307
|
+
};
|
|
308
|
+
readonly sankey: {
|
|
309
|
+
readonly width: 600;
|
|
310
|
+
readonly height: 400;
|
|
311
|
+
};
|
|
312
|
+
readonly streamgraph: {
|
|
313
|
+
readonly width: 700;
|
|
314
|
+
readonly height: 420;
|
|
315
|
+
};
|
|
316
|
+
readonly treemap: {
|
|
317
|
+
readonly width: 600;
|
|
318
|
+
readonly height: 400;
|
|
319
|
+
};
|
|
320
|
+
readonly variwide: {
|
|
321
|
+
readonly width: 600;
|
|
322
|
+
readonly height: 400;
|
|
323
|
+
};
|
|
324
|
+
readonly wordCloud: {
|
|
325
|
+
readonly width: 800;
|
|
326
|
+
readonly height: 500;
|
|
327
|
+
};
|
|
328
|
+
readonly gauge: {
|
|
329
|
+
readonly width: 360;
|
|
330
|
+
readonly height: 280;
|
|
331
|
+
};
|
|
332
|
+
readonly map: {
|
|
333
|
+
readonly width: 1000;
|
|
334
|
+
readonly height: 500;
|
|
335
|
+
};
|
|
336
|
+
readonly sparkline: {
|
|
337
|
+
readonly width: 120;
|
|
338
|
+
readonly height: 30;
|
|
339
|
+
};
|
|
340
|
+
readonly polar: {
|
|
341
|
+
readonly width: 360;
|
|
342
|
+
readonly height: 360;
|
|
343
|
+
};
|
|
344
|
+
readonly polarBar: {
|
|
345
|
+
readonly width: 400;
|
|
346
|
+
readonly height: 400;
|
|
347
|
+
};
|
|
348
|
+
readonly radar: {
|
|
349
|
+
readonly width: 360;
|
|
350
|
+
readonly height: 360;
|
|
351
|
+
};
|
|
352
|
+
readonly sunburst: {
|
|
353
|
+
readonly width: 400;
|
|
354
|
+
readonly height: 400;
|
|
355
|
+
};
|
|
356
|
+
};
|
|
357
|
+
/*********************************************************
|
|
358
|
+
* CHART_ASPECT_RATIO (#1324)
|
|
359
|
+
*
|
|
360
|
+
* @description
|
|
361
|
+
* Rapport hauteur / largeur impose a la surface de dessin des charts
|
|
362
|
+
* dont la geometrie ne se deforme pas (`useChartSize`, option
|
|
363
|
+
* `aspectRatio`). `radial` : cercle, 1:1. `gauge` : demi-anneau, rapport
|
|
364
|
+
* historique 280 / 360. `map` : planisphere 2:1.
|
|
365
|
+
********************************************************/
|
|
366
|
+
export declare const CHART_ASPECT_RATIO: {
|
|
367
|
+
readonly radial: 1;
|
|
368
|
+
readonly gauge: number;
|
|
369
|
+
readonly map: 0.5;
|
|
370
|
+
};
|
|
@@ -61,3 +61,28 @@ export const CHART_SCATTER_MIN_RADIUS = 5;
|
|
|
61
61
|
export const CHART_SCATTER_MAX_RADIUS = 36;
|
|
62
62
|
export const CHART_SLICE_LABEL_PREFIX = "Slice";
|
|
63
63
|
export const CHART_SVG_ROLE = "group";
|
|
64
|
+
export const CHART_SIZE_FALLBACK = {
|
|
65
|
+
boxPlot: { width: 600, height: 400 },
|
|
66
|
+
bullet: { width: 600, height: 400 },
|
|
67
|
+
candlestick: { width: 600, height: 400 },
|
|
68
|
+
pareto: { width: 640, height: 400 },
|
|
69
|
+
pictorial: { width: 600, height: 400 },
|
|
70
|
+
pyramid: { width: 600, height: 400 },
|
|
71
|
+
sankey: { width: 600, height: 400 },
|
|
72
|
+
streamgraph: { width: 700, height: 420 },
|
|
73
|
+
treemap: { width: 600, height: 400 },
|
|
74
|
+
variwide: { width: 600, height: 400 },
|
|
75
|
+
wordCloud: { width: 800, height: 500 },
|
|
76
|
+
gauge: { width: 360, height: 280 },
|
|
77
|
+
map: { width: 1e3, height: 500 },
|
|
78
|
+
sparkline: { width: 120, height: 30 },
|
|
79
|
+
polar: { width: 360, height: 360 },
|
|
80
|
+
polarBar: { width: 400, height: 400 },
|
|
81
|
+
radar: { width: 360, height: 360 },
|
|
82
|
+
sunburst: { width: 400, height: 400 }
|
|
83
|
+
};
|
|
84
|
+
export const CHART_ASPECT_RATIO = {
|
|
85
|
+
radial: 1,
|
|
86
|
+
gauge: 280 / 360,
|
|
87
|
+
map: 0.5
|
|
88
|
+
};
|
|
@@ -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
|
}
|