@flux-ui/statistics 3.0.0-next.68 → 3.0.0-next.70
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/FluxStatisticsLegendScope.vue.d.ts +13 -0
- package/dist/component/FluxStatisticsPercentageBar.vue.d.ts +8 -0
- package/dist/component/index.d.ts +2 -0
- package/dist/composable/index.d.ts +4 -2
- package/dist/composable/useChartBaseSetup.d.ts +8 -0
- package/dist/composable/{usePieSlicesSetup.d.ts → useChartSlicesSetup.d.ts} +2 -2
- package/dist/index.css +67 -32
- package/dist/index.js +917 -517
- package/dist/index.js.map +1 -1
- package/dist/util/index.d.ts +5 -6
- package/dist/util/options/buildBaseOptions.d.ts +2 -0
- package/dist/util/{baseOptions.d.ts → options/buildCartesianBaseOptions.d.ts} +4 -6
- package/dist/util/options/buildCircularBaseOptions.d.ts +2 -0
- package/dist/util/options/cartesian/buildAreaChartOptions.d.ts +17 -0
- package/dist/util/options/cartesian/buildBarChartOptions.d.ts +17 -0
- package/dist/util/options/cartesian/buildBoxPlotChartOptions.d.ts +16 -0
- package/dist/util/options/cartesian/buildBubbleChartOptions.d.ts +15 -0
- package/dist/util/options/cartesian/buildCandlestickChartOptions.d.ts +17 -0
- package/dist/util/options/cartesian/buildHeatmapChartOptions.d.ts +15 -0
- package/dist/util/options/cartesian/buildLineChartOptions.d.ts +17 -0
- package/dist/util/options/cartesian/buildMixedChartOptions.d.ts +17 -0
- package/dist/util/options/cartesian/buildScatterChartOptions.d.ts +15 -0
- package/dist/util/options/cartesian/index.d.ts +18 -0
- package/dist/util/options/circular/buildDonutChartOptions.d.ts +15 -0
- package/dist/util/options/circular/buildGaugeChartOptions.d.ts +14 -0
- package/dist/util/options/circular/buildPieChartOptions.d.ts +15 -0
- package/dist/util/options/circular/buildPolarAreaChartOptions.d.ts +15 -0
- package/dist/util/options/circular/buildRadarChartOptions.d.ts +13 -0
- package/dist/util/options/circular/buildTreemapChartOptions.d.ts +12 -0
- package/dist/util/options/circular/index.d.ts +12 -0
- package/dist/util/options/index.d.ts +6 -0
- package/dist/util/series/chartColors.d.ts +3 -0
- package/dist/util/{convert.d.ts → series/converters.d.ts} +1 -6
- package/dist/util/series/index.d.ts +4 -0
- package/dist/util/series/labels.d.ts +5 -0
- package/dist/util/tooltips/buildBoxPlotTooltip.d.ts +22 -0
- package/dist/util/tooltips/buildCartesianTooltip.d.ts +10 -0
- package/dist/util/tooltips/buildGaugeTooltip.d.ts +14 -0
- package/dist/util/tooltips/buildHeatmapTooltip.d.ts +17 -0
- package/dist/util/tooltips/buildRadarTooltip.d.ts +11 -0
- package/dist/util/tooltips/buildSharedItemTooltip.d.ts +10 -0
- package/dist/util/tooltips/buildTreemapTooltip.d.ts +12 -0
- package/dist/util/tooltips/index.d.ts +15 -0
- package/dist/util/tooltips/render.d.ts +4 -0
- package/dist/util/tooltips/types.d.ts +24 -0
- package/package.json +13 -13
- package/src/component/FluxStatisticsAreaChart.vue +15 -19
- package/src/component/FluxStatisticsBarChart.vue +15 -19
- package/src/component/FluxStatisticsBoxPlotChart.vue +14 -34
- package/src/component/FluxStatisticsBubbleChart.vue +13 -23
- package/src/component/FluxStatisticsCandlestickChart.vue +14 -45
- package/src/component/FluxStatisticsChart.vue +2 -2
- package/src/component/FluxStatisticsChartPane.vue +12 -13
- package/src/component/FluxStatisticsDonutChart.vue +15 -24
- package/src/component/FluxStatisticsHeatmapChart.vue +15 -48
- package/src/component/FluxStatisticsLegendScope.vue +16 -0
- package/src/component/FluxStatisticsLineChart.vue +15 -19
- package/src/component/FluxStatisticsMixedChart.vue +15 -18
- package/src/component/FluxStatisticsPercentageBar.vue +90 -0
- package/src/component/FluxStatisticsPieChart.vue +15 -24
- package/src/component/FluxStatisticsPolarAreaChart.vue +15 -24
- package/src/component/FluxStatisticsRadarChart.vue +11 -79
- package/src/component/FluxStatisticsRadialBar.vue +11 -20
- package/src/component/FluxStatisticsScatterChart.vue +13 -23
- package/src/component/FluxStatisticsTreemapChart.vue +11 -15
- package/src/component/index.ts +2 -0
- package/src/composable/index.ts +4 -2
- package/src/composable/useChartBaseSetup.ts +16 -0
- package/src/composable/{usePieSlicesSetup.ts → useChartSlicesSetup.ts} +3 -3
- package/src/css/Chart.module.scss +10 -15
- package/src/css/ChartPane.module.scss +3 -10
- package/src/css/Empty.module.scss +2 -2
- package/src/css/Legend.module.scss +16 -8
- package/src/css/Meter.module.scss +1 -0
- package/src/css/PercentageBar.module.scss +36 -0
- package/src/util/index.ts +5 -6
- package/src/util/options/buildBaseOptions.ts +31 -0
- package/src/util/{baseOptions.ts → options/buildCartesianBaseOptions.ts} +15 -22
- package/src/util/options/buildCircularBaseOptions.ts +10 -0
- package/src/util/options/cartesian/buildAreaChartOptions.ts +44 -0
- package/src/util/options/cartesian/buildBarChartOptions.ts +44 -0
- package/src/util/options/cartesian/buildBoxPlotChartOptions.ts +63 -0
- package/src/util/options/cartesian/buildBubbleChartOptions.ts +48 -0
- package/src/util/options/cartesian/buildCandlestickChartOptions.ts +77 -0
- package/src/util/options/cartesian/buildHeatmapChartOptions.ts +72 -0
- package/src/util/options/cartesian/buildLineChartOptions.ts +44 -0
- package/src/util/options/cartesian/buildMixedChartOptions.ts +44 -0
- package/src/util/options/cartesian/buildScatterChartOptions.ts +48 -0
- package/src/util/options/cartesian/index.ts +18 -0
- package/src/util/options/circular/buildDonutChartOptions.ts +31 -0
- package/src/util/options/circular/buildGaugeChartOptions.ts +45 -0
- package/src/util/options/circular/buildPieChartOptions.ts +31 -0
- package/src/util/options/circular/buildPolarAreaChartOptions.ts +31 -0
- package/src/util/options/circular/buildRadarChartOptions.ts +52 -0
- package/src/util/options/circular/buildTreemapChartOptions.ts +28 -0
- package/src/util/options/circular/index.ts +12 -0
- package/src/util/options/index.ts +6 -0
- package/src/util/series/chartColors.ts +20 -0
- package/src/util/{convert.ts → series/converters.ts} +2 -44
- package/src/util/series/index.ts +4 -0
- package/src/util/series/labels.ts +30 -0
- package/src/util/tooltips/buildBoxPlotTooltip.ts +66 -0
- package/src/util/tooltips/buildCartesianTooltip.ts +44 -0
- package/src/util/tooltips/buildGaugeTooltip.ts +49 -0
- package/src/util/tooltips/buildHeatmapTooltip.ts +57 -0
- package/src/util/tooltips/buildRadarTooltip.ts +53 -0
- package/src/util/tooltips/buildSharedItemTooltip.ts +38 -0
- package/src/util/tooltips/buildTreemapTooltip.ts +49 -0
- package/src/util/tooltips/index.ts +15 -0
- package/src/util/tooltips/render.ts +66 -0
- package/src/util/tooltips/types.ts +29 -0
- package/dist/util/defaultOptions.d.ts +0 -76
- package/src/util/defaultOptions.ts +0 -398
- /package/dist/util/{iconSvg.d.ts → icons.d.ts} +0 -0
- /package/dist/util/{seriesDefaults.d.ts → series/defaults.d.ts} +0 -0
- /package/dist/util/{sparklineOptions.d.ts → sparkline.d.ts} +0 -0
- /package/src/util/{iconSvg.ts → icons.ts} +0 -0
- /package/src/util/{seriesDefaults.ts → series/defaults.ts} +0 -0
- /package/src/util/{sparklineOptions.ts → sparkline.ts} +0 -0
|
@@ -8,15 +8,14 @@
|
|
|
8
8
|
lang="ts"
|
|
9
9
|
setup>
|
|
10
10
|
import type { FluxStatisticsChartAreaSeries } from '@flux-ui/types';
|
|
11
|
-
import { merge } from 'lodash-es';
|
|
12
11
|
import { computed } from 'vue';
|
|
13
12
|
import { useChartSeriesSetup, type EChartsOption } from '~flux/statistics/composable';
|
|
14
|
-
import {
|
|
13
|
+
import { buildAreaChartOptions, type ChartTooltipValueFormatter } from '~flux/statistics/util';
|
|
15
14
|
import Chart from './FluxStatisticsChart.vue';
|
|
16
15
|
import $style from '~flux/statistics/css/Chart.module.scss';
|
|
17
16
|
|
|
18
17
|
const {
|
|
19
|
-
advancedOptions
|
|
18
|
+
advancedOptions,
|
|
20
19
|
labels,
|
|
21
20
|
series,
|
|
22
21
|
splitLines = false,
|
|
@@ -37,20 +36,17 @@
|
|
|
37
36
|
|
|
38
37
|
const { t, palette } = useChartSeriesSetup(() => series);
|
|
39
38
|
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return merge({}, base, xAxisOverride, tooltipOptions, advancedOptions, { series: echartsSeries.value, color: palette.value });
|
|
55
|
-
});
|
|
39
|
+
const mergedOptions = computed(() => buildAreaChartOptions({
|
|
40
|
+
series,
|
|
41
|
+
labels,
|
|
42
|
+
palette: palette.value,
|
|
43
|
+
t,
|
|
44
|
+
styles: $style,
|
|
45
|
+
tooltip,
|
|
46
|
+
tooltipValueFormatter,
|
|
47
|
+
xAxisLabels,
|
|
48
|
+
yAxisLabels,
|
|
49
|
+
splitLines,
|
|
50
|
+
advancedOptions
|
|
51
|
+
}));
|
|
56
52
|
</script>
|
|
@@ -8,15 +8,14 @@
|
|
|
8
8
|
lang="ts"
|
|
9
9
|
setup>
|
|
10
10
|
import type { FluxStatisticsChartBarSeries } from '@flux-ui/types';
|
|
11
|
-
import { merge } from 'lodash-es';
|
|
12
11
|
import { computed } from 'vue';
|
|
13
12
|
import { useChartSeriesSetup, type EChartsOption } from '~flux/statistics/composable';
|
|
14
|
-
import {
|
|
13
|
+
import { buildBarChartOptions, type ChartTooltipValueFormatter } from '~flux/statistics/util';
|
|
15
14
|
import Chart from './FluxStatisticsChart.vue';
|
|
16
15
|
import $style from '~flux/statistics/css/Chart.module.scss';
|
|
17
16
|
|
|
18
17
|
const {
|
|
19
|
-
advancedOptions
|
|
18
|
+
advancedOptions,
|
|
20
19
|
labels,
|
|
21
20
|
series,
|
|
22
21
|
splitLines = false,
|
|
@@ -37,20 +36,17 @@
|
|
|
37
36
|
|
|
38
37
|
const { t, palette } = useChartSeriesSetup(() => series);
|
|
39
38
|
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return merge({}, base, xAxisOverride, tooltipOptions, advancedOptions, { series: echartsSeries.value, color: palette.value });
|
|
55
|
-
});
|
|
39
|
+
const mergedOptions = computed(() => buildBarChartOptions({
|
|
40
|
+
series,
|
|
41
|
+
labels,
|
|
42
|
+
palette: palette.value,
|
|
43
|
+
t,
|
|
44
|
+
styles: $style,
|
|
45
|
+
tooltip,
|
|
46
|
+
tooltipValueFormatter,
|
|
47
|
+
xAxisLabels,
|
|
48
|
+
yAxisLabels,
|
|
49
|
+
splitLines,
|
|
50
|
+
advancedOptions
|
|
51
|
+
}));
|
|
56
52
|
</script>
|
|
@@ -8,15 +8,14 @@
|
|
|
8
8
|
lang="ts"
|
|
9
9
|
setup>
|
|
10
10
|
import type { FluxStatisticsChartBoxPlotSeries } from '@flux-ui/types';
|
|
11
|
-
import { merge } from 'lodash-es';
|
|
12
11
|
import { computed } from 'vue';
|
|
13
12
|
import { useChartSeriesSetup, type EChartsOption } from '~flux/statistics/composable';
|
|
14
|
-
import {
|
|
13
|
+
import { buildBoxPlotChartOptions } from '~flux/statistics/util';
|
|
15
14
|
import Chart from './FluxStatisticsChart.vue';
|
|
16
15
|
import $style from '~flux/statistics/css/Chart.module.scss';
|
|
17
16
|
|
|
18
17
|
const {
|
|
19
|
-
advancedOptions
|
|
18
|
+
advancedOptions,
|
|
20
19
|
labels,
|
|
21
20
|
series,
|
|
22
21
|
splitLines = false,
|
|
@@ -35,35 +34,16 @@
|
|
|
35
34
|
|
|
36
35
|
const { t, palette } = useChartSeriesSetup(() => series);
|
|
37
36
|
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return undefined;
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
const echartsSeries = computed(() => series.map((s, i) =>
|
|
54
|
-
toBoxPlotSeries({ ...s, name: s.name ? t(String(s.name)) : undefined }, palette.value[i])
|
|
55
|
-
));
|
|
56
|
-
|
|
57
|
-
const mergedOptions = computed<EChartsOption>(() => {
|
|
58
|
-
const base = buildCartesianBaseOptions({ xAxisLabels, yAxisLabels, splitLines });
|
|
59
|
-
const xAxisOverride: EChartsOption | undefined = xLabels.value
|
|
60
|
-
? { xAxis: { type: 'category', data: xLabels.value as string[] } }
|
|
61
|
-
: undefined;
|
|
62
|
-
|
|
63
|
-
const tooltipOptions: EChartsOption = tooltip
|
|
64
|
-
? buildBoxPlotTooltipOptions(t, $style as never, () => series, () => palette.value)
|
|
65
|
-
: { tooltip: { show: false } };
|
|
66
|
-
|
|
67
|
-
return merge({}, base, xAxisOverride ?? {}, tooltipOptions, advancedOptions, { series: echartsSeries.value, color: palette.value });
|
|
68
|
-
});
|
|
37
|
+
const mergedOptions = computed(() => buildBoxPlotChartOptions({
|
|
38
|
+
series,
|
|
39
|
+
labels,
|
|
40
|
+
palette: palette.value,
|
|
41
|
+
t,
|
|
42
|
+
styles: $style,
|
|
43
|
+
tooltip,
|
|
44
|
+
xAxisLabels,
|
|
45
|
+
yAxisLabels,
|
|
46
|
+
splitLines,
|
|
47
|
+
advancedOptions
|
|
48
|
+
}));
|
|
69
49
|
</script>
|
|
@@ -8,15 +8,14 @@
|
|
|
8
8
|
lang="ts"
|
|
9
9
|
setup>
|
|
10
10
|
import type { FluxStatisticsChartBubbleSeries } from '@flux-ui/types';
|
|
11
|
-
import { merge } from 'lodash-es';
|
|
12
11
|
import { computed } from 'vue';
|
|
13
12
|
import { useChartSeriesSetup, type EChartsOption } from '~flux/statistics/composable';
|
|
14
|
-
import {
|
|
13
|
+
import { buildBubbleChartOptions } from '~flux/statistics/util';
|
|
15
14
|
import Chart from './FluxStatisticsChart.vue';
|
|
16
15
|
import $style from '~flux/statistics/css/Chart.module.scss';
|
|
17
16
|
|
|
18
17
|
const {
|
|
19
|
-
advancedOptions
|
|
18
|
+
advancedOptions,
|
|
20
19
|
series,
|
|
21
20
|
splitLines = false,
|
|
22
21
|
tooltip = false,
|
|
@@ -33,24 +32,15 @@
|
|
|
33
32
|
|
|
34
33
|
const { t, palette } = useChartSeriesSetup(() => series);
|
|
35
34
|
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
splitLines
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
const tooltipOptions: EChartsOption = tooltip
|
|
51
|
-
? buildCartesianTooltipOptions(t, $style as never, () => series.map(s => s.icon))
|
|
52
|
-
: { tooltip: { show: false } };
|
|
53
|
-
|
|
54
|
-
return merge({}, base, tooltipOptions, advancedOptions, { series: echartsSeries.value, color: palette.value });
|
|
55
|
-
});
|
|
35
|
+
const mergedOptions = computed(() => buildBubbleChartOptions({
|
|
36
|
+
series,
|
|
37
|
+
palette: palette.value,
|
|
38
|
+
t,
|
|
39
|
+
styles: $style,
|
|
40
|
+
tooltip,
|
|
41
|
+
xAxisLabels,
|
|
42
|
+
yAxisLabels,
|
|
43
|
+
splitLines,
|
|
44
|
+
advancedOptions
|
|
45
|
+
}));
|
|
56
46
|
</script>
|
|
@@ -8,15 +8,14 @@
|
|
|
8
8
|
lang="ts"
|
|
9
9
|
setup>
|
|
10
10
|
import type { FluxStatisticsChartCandlestickSeries } from '@flux-ui/types';
|
|
11
|
-
import { merge } from 'lodash-es';
|
|
12
11
|
import { computed } from 'vue';
|
|
13
12
|
import { useChartSeriesSetup, type EChartsOption } from '~flux/statistics/composable';
|
|
14
|
-
import {
|
|
13
|
+
import { buildCandlestickChartOptions, candlestickLegendItemBuilder } from '~flux/statistics/util';
|
|
15
14
|
import Chart from './FluxStatisticsChart.vue';
|
|
16
15
|
import $style from '~flux/statistics/css/Chart.module.scss';
|
|
17
16
|
|
|
18
17
|
const {
|
|
19
|
-
advancedOptions
|
|
18
|
+
advancedOptions,
|
|
20
19
|
labels,
|
|
21
20
|
series,
|
|
22
21
|
splitLines = false,
|
|
@@ -34,48 +33,18 @@
|
|
|
34
33
|
}>();
|
|
35
34
|
|
|
36
35
|
const { t } = useChartSeriesSetup(() => series, {
|
|
37
|
-
getLegendItem:
|
|
38
|
-
{
|
|
39
|
-
color: resolveChartColor(s.positiveColor) ?? 'var(--success-500)',
|
|
40
|
-
icon: s.icon,
|
|
41
|
-
label: 'Up'
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
color: resolveChartColor(s.negativeColor) ?? 'var(--danger-500)',
|
|
45
|
-
label: 'Down'
|
|
46
|
-
}
|
|
47
|
-
]
|
|
36
|
+
getLegendItem: candlestickLegendItemBuilder
|
|
48
37
|
});
|
|
49
38
|
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return undefined;
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
const echartsSeries = computed(() => series.map(s =>
|
|
66
|
-
toCandlestickSeries({ ...s, name: s.name ? t(String(s.name)) : undefined })
|
|
67
|
-
));
|
|
68
|
-
|
|
69
|
-
const mergedOptions = computed<EChartsOption>(() => {
|
|
70
|
-
const base = buildCartesianBaseOptions({ scale: true, xAxisLabels, yAxisLabels, splitLines });
|
|
71
|
-
const xAxisOverride: EChartsOption | undefined = xLabels.value
|
|
72
|
-
? { xAxis: { type: 'category', data: xLabels.value as string[] } }
|
|
73
|
-
: undefined;
|
|
74
|
-
|
|
75
|
-
const tooltipOptions: EChartsOption = tooltip
|
|
76
|
-
? buildCartesianTooltipOptions(t, $style as never, () => series.map(s => s.icon))
|
|
77
|
-
: { tooltip: { show: false } };
|
|
78
|
-
|
|
79
|
-
return merge({}, base, xAxisOverride ?? {}, tooltipOptions, advancedOptions, { series: echartsSeries.value });
|
|
80
|
-
});
|
|
39
|
+
const mergedOptions = computed(() => buildCandlestickChartOptions({
|
|
40
|
+
series,
|
|
41
|
+
labels,
|
|
42
|
+
t,
|
|
43
|
+
styles: $style,
|
|
44
|
+
tooltip,
|
|
45
|
+
xAxisLabels,
|
|
46
|
+
yAxisLabels,
|
|
47
|
+
splitLines,
|
|
48
|
+
advancedOptions
|
|
49
|
+
}));
|
|
81
50
|
</script>
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import { merge } from 'lodash-es';
|
|
11
11
|
import { computed, useTemplateRef } from 'vue';
|
|
12
12
|
import { type EChartsOption, useECharts } from '~flux/statistics/composable';
|
|
13
|
-
import {
|
|
13
|
+
import { buildBaseOptions, deepResolveCssVars } from '~flux/statistics/util';
|
|
14
14
|
import $style from '~flux/statistics/css/Chart.module.scss';
|
|
15
15
|
|
|
16
16
|
const {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
const chart = useTemplateRef('chart');
|
|
23
23
|
|
|
24
|
-
const defaults =
|
|
24
|
+
const defaults = buildBaseOptions();
|
|
25
25
|
|
|
26
26
|
const mergedOptions = computed<EChartsOption>(() => {
|
|
27
27
|
const merged = merge({}, defaults, options) as EChartsOption & { color?: unknown; series?: unknown };
|
|
@@ -15,17 +15,19 @@
|
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
17
|
<template #content>
|
|
18
|
-
<
|
|
19
|
-
<div :class="$style.
|
|
20
|
-
<
|
|
21
|
-
|
|
18
|
+
<FluxStatisticsLegendScope>
|
|
19
|
+
<div :class="$style.statisticsChartPaneBody">
|
|
20
|
+
<div :class="$style.statisticsChartPaneContainer">
|
|
21
|
+
<slot/>
|
|
22
|
+
</div>
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
<slot name="legend"/>
|
|
25
|
+
</div>
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
<FluxToolbar v-if="slots.toolbar">
|
|
28
|
+
<slot name="toolbar"/>
|
|
29
|
+
</FluxToolbar>
|
|
30
|
+
</FluxStatisticsLegendScope>
|
|
29
31
|
</template>
|
|
30
32
|
</Base>
|
|
31
33
|
</template>
|
|
@@ -35,9 +37,8 @@
|
|
|
35
37
|
setup>
|
|
36
38
|
import { FluxToolbar } from '@flux-ui/components';
|
|
37
39
|
import type { FluxIconName } from '@flux-ui/types';
|
|
38
|
-
import { provide } from 'vue';
|
|
39
|
-
import { createChartLegendContext, FluxStatisticsChartLegendInjectionKey } from '~flux/statistics/composable';
|
|
40
40
|
import Base from './FluxStatisticsBase.vue';
|
|
41
|
+
import FluxStatisticsLegendScope from './FluxStatisticsLegendScope.vue';
|
|
41
42
|
import $style from '~flux/statistics/css/ChartPane.module.scss';
|
|
42
43
|
|
|
43
44
|
defineProps<{
|
|
@@ -54,6 +55,4 @@
|
|
|
54
55
|
legend?(): any;
|
|
55
56
|
toolbar?(): any;
|
|
56
57
|
}>();
|
|
57
|
-
|
|
58
|
-
provide(FluxStatisticsChartLegendInjectionKey, createChartLegendContext());
|
|
59
58
|
</script>
|
|
@@ -8,15 +8,14 @@
|
|
|
8
8
|
lang="ts"
|
|
9
9
|
setup>
|
|
10
10
|
import type { FluxStatisticsChartPieSlice } from '@flux-ui/types';
|
|
11
|
-
import { merge } from 'lodash-es';
|
|
12
11
|
import { computed } from 'vue';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
12
|
+
import { useChartSlicesSetup, type EChartsOption } from '~flux/statistics/composable';
|
|
13
|
+
import { buildDonutChartOptions, type ChartTooltipValueFormatter } from '~flux/statistics/util';
|
|
15
14
|
import Chart from './FluxStatisticsChart.vue';
|
|
16
15
|
import $style from '~flux/statistics/css/Chart.module.scss';
|
|
17
16
|
|
|
18
17
|
const {
|
|
19
|
-
advancedOptions
|
|
18
|
+
advancedOptions,
|
|
20
19
|
slices,
|
|
21
20
|
title,
|
|
22
21
|
tooltip = false,
|
|
@@ -29,25 +28,17 @@
|
|
|
29
28
|
readonly tooltipValueFormatter?: ChartTooltipValueFormatter;
|
|
30
29
|
}>();
|
|
31
30
|
|
|
32
|
-
const { t, palette, tooltipItems } =
|
|
31
|
+
const { t, palette, tooltipItems } = useChartSlicesSetup(() => slices);
|
|
33
32
|
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
formatter: buildSharedItemTooltipFormatter(t, $style as never, () => tooltipItems.value, () => title, tooltipValueFormatter) as never
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
const mergedOptions = computed<EChartsOption>(() =>
|
|
51
|
-
merge({}, POLAR_BASE_OPTIONS, tooltipOptions.value, advancedOptions, { series: echartsSeries.value, color: palette.value })
|
|
52
|
-
);
|
|
33
|
+
const mergedOptions = computed(() => buildDonutChartOptions({
|
|
34
|
+
slices,
|
|
35
|
+
palette: palette.value,
|
|
36
|
+
tooltipItems: tooltipItems.value,
|
|
37
|
+
title,
|
|
38
|
+
t,
|
|
39
|
+
styles: $style,
|
|
40
|
+
tooltip,
|
|
41
|
+
tooltipValueFormatter,
|
|
42
|
+
advancedOptions
|
|
43
|
+
}));
|
|
53
44
|
</script>
|
|
@@ -6,18 +6,15 @@
|
|
|
6
6
|
<script
|
|
7
7
|
lang="ts"
|
|
8
8
|
setup>
|
|
9
|
-
import { blue100, blue300, blue500, blue700 } from '@flux-ui/internals';
|
|
10
9
|
import type { FluxStatisticsChartHeatmapSeries } from '@flux-ui/types';
|
|
11
|
-
import { merge } from 'lodash-es';
|
|
12
10
|
import { computed } from 'vue';
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import { buildCartesianBaseOptions, buildHeatmapTooltipOptions, toHeatmapSeries } from '~flux/statistics/util';
|
|
11
|
+
import { useChartBaseSetup, type EChartsOption } from '~flux/statistics/composable';
|
|
12
|
+
import { buildHeatmapChartOptions } from '~flux/statistics/util';
|
|
16
13
|
import Chart from './FluxStatisticsChart.vue';
|
|
17
14
|
import $style from '~flux/statistics/css/Chart.module.scss';
|
|
18
15
|
|
|
19
16
|
const {
|
|
20
|
-
advancedOptions
|
|
17
|
+
advancedOptions,
|
|
21
18
|
series,
|
|
22
19
|
tooltip = false,
|
|
23
20
|
xAxisLabels = false,
|
|
@@ -34,47 +31,17 @@
|
|
|
34
31
|
readonly yLabels?: readonly string[];
|
|
35
32
|
}>();
|
|
36
33
|
|
|
37
|
-
const {t} =
|
|
34
|
+
const { t } = useChartBaseSetup();
|
|
38
35
|
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
visualMap: {
|
|
51
|
-
show: false,
|
|
52
|
-
min: 0,
|
|
53
|
-
max: 100,
|
|
54
|
-
inRange: { color: [blue100, blue300, blue500, blue700] }
|
|
55
|
-
},
|
|
56
|
-
xAxis: {
|
|
57
|
-
type: 'category',
|
|
58
|
-
data: translatedXLabels.value as string[],
|
|
59
|
-
axisLabel: { show: xAxisLabels, color: 'var(--foreground-secondary)' },
|
|
60
|
-
axisLine: { show: false },
|
|
61
|
-
axisTick: { show: false },
|
|
62
|
-
splitLine: { show: false }
|
|
63
|
-
},
|
|
64
|
-
yAxis: {
|
|
65
|
-
type: 'category',
|
|
66
|
-
data: translatedYLabels.value as string[],
|
|
67
|
-
axisLabel: { show: yAxisLabels, color: 'var(--foreground-secondary)' },
|
|
68
|
-
axisLine: { show: false },
|
|
69
|
-
axisTick: { show: false },
|
|
70
|
-
splitLine: { show: false }
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const tooltipOptions: EChartsOption = tooltip
|
|
75
|
-
? buildHeatmapTooltipOptions(t, $style as never, () => series)
|
|
76
|
-
: { tooltip: { show: false } };
|
|
77
|
-
|
|
78
|
-
return merge({}, base, tooltipOptions, advancedOptions, { series: echartsSeries.value });
|
|
79
|
-
});
|
|
36
|
+
const mergedOptions = computed(() => buildHeatmapChartOptions({
|
|
37
|
+
series,
|
|
38
|
+
xLabels,
|
|
39
|
+
yLabels,
|
|
40
|
+
t,
|
|
41
|
+
styles: $style,
|
|
42
|
+
tooltip,
|
|
43
|
+
xAxisLabels,
|
|
44
|
+
yAxisLabels,
|
|
45
|
+
advancedOptions
|
|
46
|
+
}));
|
|
80
47
|
</script>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<slot/>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script
|
|
6
|
+
lang="ts"
|
|
7
|
+
setup>
|
|
8
|
+
import { provide } from 'vue';
|
|
9
|
+
import { createChartLegendContext, FluxStatisticsChartLegendInjectionKey } from '~flux/statistics/composable';
|
|
10
|
+
|
|
11
|
+
defineSlots<{
|
|
12
|
+
default(): any;
|
|
13
|
+
}>();
|
|
14
|
+
|
|
15
|
+
provide(FluxStatisticsChartLegendInjectionKey, createChartLegendContext());
|
|
16
|
+
</script>
|
|
@@ -8,15 +8,14 @@
|
|
|
8
8
|
lang="ts"
|
|
9
9
|
setup>
|
|
10
10
|
import type { FluxStatisticsChartLineSeries } from '@flux-ui/types';
|
|
11
|
-
import { merge } from 'lodash-es';
|
|
12
11
|
import { computed } from 'vue';
|
|
13
12
|
import { useChartSeriesSetup, type EChartsOption } from '~flux/statistics/composable';
|
|
14
|
-
import {
|
|
13
|
+
import { buildLineChartOptions, type ChartTooltipValueFormatter } from '~flux/statistics/util';
|
|
15
14
|
import Chart from './FluxStatisticsChart.vue';
|
|
16
15
|
import $style from '~flux/statistics/css/Chart.module.scss';
|
|
17
16
|
|
|
18
17
|
const {
|
|
19
|
-
advancedOptions
|
|
18
|
+
advancedOptions,
|
|
20
19
|
labels,
|
|
21
20
|
series,
|
|
22
21
|
splitLines = false,
|
|
@@ -37,20 +36,17 @@
|
|
|
37
36
|
|
|
38
37
|
const { t, palette } = useChartSeriesSetup(() => series);
|
|
39
38
|
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return merge({}, base, xAxisOverride, tooltipOptions, advancedOptions, { series: echartsSeries.value, color: palette.value });
|
|
55
|
-
});
|
|
39
|
+
const mergedOptions = computed(() => buildLineChartOptions({
|
|
40
|
+
series,
|
|
41
|
+
labels,
|
|
42
|
+
palette: palette.value,
|
|
43
|
+
t,
|
|
44
|
+
styles: $style,
|
|
45
|
+
tooltip,
|
|
46
|
+
tooltipValueFormatter,
|
|
47
|
+
xAxisLabels,
|
|
48
|
+
yAxisLabels,
|
|
49
|
+
splitLines,
|
|
50
|
+
advancedOptions
|
|
51
|
+
}));
|
|
56
52
|
</script>
|
|
@@ -8,15 +8,14 @@
|
|
|
8
8
|
lang="ts"
|
|
9
9
|
setup>
|
|
10
10
|
import type { FluxStatisticsChartMixedSeries } from '@flux-ui/types';
|
|
11
|
-
import { merge } from 'lodash-es';
|
|
12
11
|
import { computed } from 'vue';
|
|
13
12
|
import { useChartSeriesSetup, type EChartsOption } from '~flux/statistics/composable';
|
|
14
|
-
import {
|
|
13
|
+
import { buildMixedChartOptions, type ChartTooltipValueFormatter } from '~flux/statistics/util';
|
|
15
14
|
import Chart from './FluxStatisticsChart.vue';
|
|
16
15
|
import $style from '~flux/statistics/css/Chart.module.scss';
|
|
17
16
|
|
|
18
17
|
const {
|
|
19
|
-
advancedOptions
|
|
18
|
+
advancedOptions,
|
|
20
19
|
labels,
|
|
21
20
|
series,
|
|
22
21
|
splitLines = false,
|
|
@@ -37,19 +36,17 @@
|
|
|
37
36
|
|
|
38
37
|
const { t, palette } = useChartSeriesSetup(() => series);
|
|
39
38
|
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return merge({}, base, xAxisOverride, tooltipOptions, advancedOptions, { series: echartsSeries.value, color: palette.value });
|
|
54
|
-
});
|
|
39
|
+
const mergedOptions = computed(() => buildMixedChartOptions({
|
|
40
|
+
series,
|
|
41
|
+
labels,
|
|
42
|
+
palette: palette.value,
|
|
43
|
+
t,
|
|
44
|
+
styles: $style,
|
|
45
|
+
tooltip,
|
|
46
|
+
tooltipValueFormatter,
|
|
47
|
+
xAxisLabels,
|
|
48
|
+
yAxisLabels,
|
|
49
|
+
splitLines,
|
|
50
|
+
advancedOptions
|
|
51
|
+
}));
|
|
55
52
|
</script>
|