@flux-ui/statistics 3.2.0-beta.1 → 3.2.0-beta.11
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/dist/component/FluxStatisticsBubbleChart.vue.d.ts +2 -0
- package/dist/component/FluxStatisticsScatterChart.vue.d.ts +2 -0
- package/dist/composable/useChartBaseSetup.d.ts +0 -3
- package/dist/index.css +2 -0
- package/dist/index.js +85 -65
- package/dist/index.js.map +1 -1
- package/dist/util/options/cartesian/buildBubbleChartOptions.d.ts +2 -1
- package/dist/util/options/cartesian/buildScatterChartOptions.d.ts +2 -1
- package/package.json +10 -10
- package/src/component/FluxStatisticsBase.vue +4 -2
- package/src/component/FluxStatisticsBubbleChart.vue +4 -1
- package/src/component/FluxStatisticsDetailsTable.vue +3 -2
- package/src/component/FluxStatisticsLegend.vue +1 -2
- package/src/component/FluxStatisticsScatterChart.vue +4 -1
- package/src/composable/useChartBaseSetup.ts +1 -6
- package/src/css/ChartPane.module.scss +2 -0
- package/src/util/options/cartesian/buildBubbleChartOptions.ts +4 -3
- package/src/util/options/cartesian/buildScatterChartOptions.ts +4 -3
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { FluxStatisticsChartBubbleSeries } from '@flux-ui/types';
|
|
2
2
|
import { EChartsOption } from '../../../composable';
|
|
3
|
-
import { TooltipStyleClasses, Translator } from '../../tooltips';
|
|
3
|
+
import { ChartTooltipValueFormatter, TooltipStyleClasses, Translator } from '../../tooltips';
|
|
4
4
|
export interface BubbleChartOptionsInput {
|
|
5
5
|
readonly series: readonly FluxStatisticsChartBubbleSeries[];
|
|
6
6
|
readonly palette: readonly string[];
|
|
7
7
|
readonly t: Translator;
|
|
8
8
|
readonly styles: TooltipStyleClasses;
|
|
9
9
|
readonly tooltip?: boolean;
|
|
10
|
+
readonly tooltipValueFormatter?: ChartTooltipValueFormatter;
|
|
10
11
|
readonly xAxisLabels?: boolean;
|
|
11
12
|
readonly yAxisLabels?: boolean;
|
|
12
13
|
readonly splitLines?: boolean;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { FluxStatisticsChartScatterSeries } from '@flux-ui/types';
|
|
2
2
|
import { EChartsOption } from '../../../composable';
|
|
3
|
-
import { TooltipStyleClasses, Translator } from '../../tooltips';
|
|
3
|
+
import { ChartTooltipValueFormatter, TooltipStyleClasses, Translator } from '../../tooltips';
|
|
4
4
|
export interface ScatterChartOptionsInput {
|
|
5
5
|
readonly series: readonly FluxStatisticsChartScatterSeries[];
|
|
6
6
|
readonly palette: readonly string[];
|
|
7
7
|
readonly t: Translator;
|
|
8
8
|
readonly styles: TooltipStyleClasses;
|
|
9
9
|
readonly tooltip?: boolean;
|
|
10
|
+
readonly tooltipValueFormatter?: ChartTooltipValueFormatter;
|
|
10
11
|
readonly xAxisLabels?: boolean;
|
|
11
12
|
readonly yAxisLabels?: boolean;
|
|
12
13
|
readonly splitLines?: boolean;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flux-ui/statistics",
|
|
3
3
|
"description": "Statistics components for the Flux UI library.",
|
|
4
|
-
"version": "3.2.0-beta.
|
|
4
|
+
"version": "3.2.0-beta.11",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/basmilius",
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
"types": "./dist/index.d.ts",
|
|
50
50
|
"sideEffects": false,
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@basmilius/common": "^3.
|
|
53
|
-
"@basmilius/utils": "^3.
|
|
54
|
-
"@flux-ui/components": "3.2.0-beta.
|
|
55
|
-
"@flux-ui/internals": "3.2.0-beta.
|
|
56
|
-
"@flux-ui/types": "3.2.0-beta.
|
|
52
|
+
"@basmilius/common": "^3.50.0",
|
|
53
|
+
"@basmilius/utils": "^3.50.0",
|
|
54
|
+
"@flux-ui/components": "3.2.0-beta.11",
|
|
55
|
+
"@flux-ui/internals": "3.2.0-beta.11",
|
|
56
|
+
"@flux-ui/types": "3.2.0-beta.11",
|
|
57
57
|
"clsx": "^2.1.1"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
@@ -63,14 +63,14 @@
|
|
|
63
63
|
"vue-i18n": "^11.4.6"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@basmilius/vite-preset": "^3.
|
|
66
|
+
"@basmilius/vite-preset": "^3.50.0",
|
|
67
67
|
"@types/lodash-es": "^4.17.12",
|
|
68
|
-
"@types/node": "^26.0
|
|
68
|
+
"@types/node": "^26.1.0",
|
|
69
69
|
"@vitejs/plugin-vue": "^6.0.7",
|
|
70
70
|
"@vue/tsconfig": "^0.9.1",
|
|
71
71
|
"sass-embedded": "^1.100.0",
|
|
72
72
|
"typescript": "^6.0.3",
|
|
73
|
-
"vite": "^8.1.
|
|
74
|
-
"vue-tsc": "^3.3.
|
|
73
|
+
"vite": "^8.1.3",
|
|
74
|
+
"vue-tsc": "^3.3.6"
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FluxPane :class="isSmall ? $style.statisticsBaseSmall : $style.statisticsBase">
|
|
3
3
|
<div
|
|
4
|
-
v-if="title"
|
|
4
|
+
v-if="title || icon || slots.info"
|
|
5
5
|
:class="$style.statisticsBaseHeader">
|
|
6
|
-
<span
|
|
6
|
+
<span
|
|
7
|
+
v-if="title"
|
|
8
|
+
:class="$style.statisticsBaseHeaderTitle">
|
|
7
9
|
{{ title }}
|
|
8
10
|
</span>
|
|
9
11
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import type { FluxStatisticsChartBubbleSeries } from '@flux-ui/types';
|
|
11
11
|
import { computed } from 'vue';
|
|
12
12
|
import { type EChartsOption, useChartSeriesSetup } from '~flux/statistics/composable';
|
|
13
|
-
import { buildBubbleChartOptions } from '~flux/statistics/util';
|
|
13
|
+
import { buildBubbleChartOptions, type ChartTooltipValueFormatter } from '~flux/statistics/util';
|
|
14
14
|
import Chart from './FluxStatisticsChart.vue';
|
|
15
15
|
import $style from '~flux/statistics/css/Chart.module.scss';
|
|
16
16
|
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
series,
|
|
20
20
|
splitLines = false,
|
|
21
21
|
tooltip = false,
|
|
22
|
+
tooltipValueFormatter,
|
|
22
23
|
xAxisLabels = false,
|
|
23
24
|
yAxisLabels = false
|
|
24
25
|
} = defineProps<{
|
|
@@ -26,6 +27,7 @@
|
|
|
26
27
|
readonly series: readonly FluxStatisticsChartBubbleSeries[];
|
|
27
28
|
readonly splitLines?: boolean;
|
|
28
29
|
readonly tooltip?: boolean;
|
|
30
|
+
readonly tooltipValueFormatter?: ChartTooltipValueFormatter;
|
|
29
31
|
readonly xAxisLabels?: boolean;
|
|
30
32
|
readonly yAxisLabels?: boolean;
|
|
31
33
|
}>();
|
|
@@ -38,6 +40,7 @@
|
|
|
38
40
|
t,
|
|
39
41
|
styles: $style,
|
|
40
42
|
tooltip,
|
|
43
|
+
tooltipValueFormatter,
|
|
41
44
|
xAxisLabels,
|
|
42
45
|
yAxisLabels,
|
|
43
46
|
splitLines,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
ref="list"
|
|
4
4
|
role="list"
|
|
5
5
|
:class="containerClass">
|
|
6
|
-
<slot v-if="
|
|
6
|
+
<slot v-if="slots.default"/>
|
|
7
7
|
<FluxStatisticsLegendItem
|
|
8
8
|
v-else
|
|
9
9
|
v-for="(item, index) in autoItems"
|
|
@@ -48,7 +48,6 @@
|
|
|
48
48
|
// geometrically. Focusing an item drives the same hover sync as the mouse.
|
|
49
49
|
useFocusZone(listRef, {direction: 'bidirectional'});
|
|
50
50
|
|
|
51
|
-
const hasSlot = computed(() => !!slots.default);
|
|
52
51
|
const autoItems = computed(() => legendContext?.items.value ?? []);
|
|
53
52
|
|
|
54
53
|
const containerClass = computed(() => {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import type { FluxStatisticsChartScatterSeries } from '@flux-ui/types';
|
|
11
11
|
import { computed } from 'vue';
|
|
12
12
|
import { type EChartsOption, useChartSeriesSetup } from '~flux/statistics/composable';
|
|
13
|
-
import { buildScatterChartOptions } from '~flux/statistics/util';
|
|
13
|
+
import { buildScatterChartOptions, type ChartTooltipValueFormatter } from '~flux/statistics/util';
|
|
14
14
|
import Chart from './FluxStatisticsChart.vue';
|
|
15
15
|
import $style from '~flux/statistics/css/Chart.module.scss';
|
|
16
16
|
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
series,
|
|
20
20
|
splitLines = false,
|
|
21
21
|
tooltip = false,
|
|
22
|
+
tooltipValueFormatter,
|
|
22
23
|
xAxisLabels = false,
|
|
23
24
|
yAxisLabels = false
|
|
24
25
|
} = defineProps<{
|
|
@@ -26,6 +27,7 @@
|
|
|
26
27
|
readonly series: readonly FluxStatisticsChartScatterSeries[];
|
|
27
28
|
readonly splitLines?: boolean;
|
|
28
29
|
readonly tooltip?: boolean;
|
|
30
|
+
readonly tooltipValueFormatter?: ChartTooltipValueFormatter;
|
|
29
31
|
readonly xAxisLabels?: boolean;
|
|
30
32
|
readonly yAxisLabels?: boolean;
|
|
31
33
|
}>();
|
|
@@ -38,6 +40,7 @@
|
|
|
38
40
|
t,
|
|
39
41
|
styles: $style,
|
|
40
42
|
tooltip,
|
|
43
|
+
tooltipValueFormatter,
|
|
41
44
|
xAxisLabels,
|
|
42
45
|
yAxisLabels,
|
|
43
46
|
splitLines,
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import { computed, useTemplateRef, type ComputedRef } from 'vue';
|
|
2
1
|
import { useI18n } from 'vue-i18n';
|
|
3
|
-
import type { EChartsInstance } from './useECharts';
|
|
4
2
|
|
|
5
3
|
export interface UseChartBaseSetupReturn {
|
|
6
4
|
readonly t: ReturnType<typeof useI18n>['t'];
|
|
7
|
-
readonly chartInstance: ComputedRef<EChartsInstance | null>;
|
|
8
5
|
}
|
|
9
6
|
|
|
10
7
|
export function useChartBaseSetup(): UseChartBaseSetupReturn {
|
|
11
8
|
const { t } = useI18n({ useScope: 'parent' });
|
|
12
|
-
const chartRef = useTemplateRef<{ chartInstance: EChartsInstance | null } | null>('chartRef');
|
|
13
|
-
const chartInstance = computed<EChartsInstance | null>(() => chartRef.value?.chartInstance ?? null);
|
|
14
9
|
|
|
15
|
-
return { t
|
|
10
|
+
return { t };
|
|
16
11
|
}
|
|
@@ -2,7 +2,7 @@ import type { FluxStatisticsChartBubbleSeries } from '@flux-ui/types';
|
|
|
2
2
|
import { merge } from 'lodash-es';
|
|
3
3
|
import type { EChartsOption } from '~flux/statistics/composable';
|
|
4
4
|
import { toBubbleSeries } from '../../series';
|
|
5
|
-
import type { TooltipStyleClasses, Translator } from '../../tooltips';
|
|
5
|
+
import type { ChartTooltipValueFormatter, TooltipStyleClasses, Translator } from '../../tooltips';
|
|
6
6
|
import { buildCartesianTooltip } from '../../tooltips';
|
|
7
7
|
import { buildCartesianBaseOptions } from '../buildCartesianBaseOptions';
|
|
8
8
|
|
|
@@ -12,6 +12,7 @@ export interface BubbleChartOptionsInput {
|
|
|
12
12
|
readonly t: Translator;
|
|
13
13
|
readonly styles: TooltipStyleClasses;
|
|
14
14
|
readonly tooltip?: boolean;
|
|
15
|
+
readonly tooltipValueFormatter?: ChartTooltipValueFormatter;
|
|
15
16
|
readonly xAxisLabels?: boolean;
|
|
16
17
|
readonly yAxisLabels?: boolean;
|
|
17
18
|
readonly splitLines?: boolean;
|
|
@@ -21,7 +22,7 @@ export interface BubbleChartOptionsInput {
|
|
|
21
22
|
export function buildBubbleChartOptions(input: BubbleChartOptionsInput): EChartsOption {
|
|
22
23
|
const {
|
|
23
24
|
series, palette, t, styles,
|
|
24
|
-
tooltip = false,
|
|
25
|
+
tooltip = false, tooltipValueFormatter,
|
|
25
26
|
xAxisLabels = false, yAxisLabels = false, splitLines = false,
|
|
26
27
|
advancedOptions = {}
|
|
27
28
|
} = input;
|
|
@@ -37,7 +38,7 @@ export function buildBubbleChartOptions(input: BubbleChartOptionsInput): ECharts
|
|
|
37
38
|
});
|
|
38
39
|
|
|
39
40
|
const tooltipOptions: EChartsOption = tooltip
|
|
40
|
-
? buildCartesianTooltip({ t, styles, getSeriesIcons: () => series.map(s => s.icon) })
|
|
41
|
+
? buildCartesianTooltip({ t, styles, getSeriesIcons: () => series.map(s => s.icon), valueFormatter: tooltipValueFormatter })
|
|
41
42
|
: { tooltip: { show: false } };
|
|
42
43
|
|
|
43
44
|
const echartsSeries = series.map((s, i) =>
|
|
@@ -2,7 +2,7 @@ import type { FluxStatisticsChartScatterSeries } from '@flux-ui/types';
|
|
|
2
2
|
import { merge } from 'lodash-es';
|
|
3
3
|
import type { EChartsOption } from '~flux/statistics/composable';
|
|
4
4
|
import { toScatterSeries } from '../../series';
|
|
5
|
-
import type { TooltipStyleClasses, Translator } from '../../tooltips';
|
|
5
|
+
import type { ChartTooltipValueFormatter, TooltipStyleClasses, Translator } from '../../tooltips';
|
|
6
6
|
import { buildCartesianTooltip } from '../../tooltips';
|
|
7
7
|
import { buildCartesianBaseOptions } from '../buildCartesianBaseOptions';
|
|
8
8
|
|
|
@@ -12,6 +12,7 @@ export interface ScatterChartOptionsInput {
|
|
|
12
12
|
readonly t: Translator;
|
|
13
13
|
readonly styles: TooltipStyleClasses;
|
|
14
14
|
readonly tooltip?: boolean;
|
|
15
|
+
readonly tooltipValueFormatter?: ChartTooltipValueFormatter;
|
|
15
16
|
readonly xAxisLabels?: boolean;
|
|
16
17
|
readonly yAxisLabels?: boolean;
|
|
17
18
|
readonly splitLines?: boolean;
|
|
@@ -21,7 +22,7 @@ export interface ScatterChartOptionsInput {
|
|
|
21
22
|
export function buildScatterChartOptions(input: ScatterChartOptionsInput): EChartsOption {
|
|
22
23
|
const {
|
|
23
24
|
series, palette, t, styles,
|
|
24
|
-
tooltip = false,
|
|
25
|
+
tooltip = false, tooltipValueFormatter,
|
|
25
26
|
xAxisLabels = false, yAxisLabels = false, splitLines = false,
|
|
26
27
|
advancedOptions = {}
|
|
27
28
|
} = input;
|
|
@@ -37,7 +38,7 @@ export function buildScatterChartOptions(input: ScatterChartOptionsInput): EChar
|
|
|
37
38
|
});
|
|
38
39
|
|
|
39
40
|
const tooltipOptions: EChartsOption = tooltip
|
|
40
|
-
? buildCartesianTooltip({ t, styles, getSeriesIcons: () => series.map(s => s.icon) })
|
|
41
|
+
? buildCartesianTooltip({ t, styles, getSeriesIcons: () => series.map(s => s.icon), valueFormatter: tooltipValueFormatter })
|
|
41
42
|
: { tooltip: { show: false } };
|
|
42
43
|
|
|
43
44
|
const echartsSeries = series.map((s, i) =>
|