mirror of
https://github.com/keven1024/015.git
synced 2026-06-08 13:24:33 +00:00
feat(front): add card and chart components for enhanced UI and data visualization
This commit is contained in:
21
front/components/ui/chart/index.ts
Normal file
21
front/components/ui/chart/index.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
export { default as ChartCrosshair } from "./ChartCrosshair.vue";
|
||||
export { default as ChartLegend } from "./ChartLegend.vue";
|
||||
export { default as ChartSingleTooltip } from "./ChartSingleTooltip.vue";
|
||||
export { default as ChartTooltip } from "./ChartTooltip.vue";
|
||||
|
||||
export function defaultColors(count: number = 3) {
|
||||
const quotient = Math.floor(count / 2);
|
||||
const remainder = count % 2;
|
||||
|
||||
const primaryCount = quotient + remainder;
|
||||
const secondaryCount = quotient;
|
||||
return [
|
||||
...Array.from(new Array(primaryCount).keys()).map(
|
||||
(i) => `hsl(var(--vis-primary-color) / ${1 - (1 / primaryCount) * i})`,
|
||||
),
|
||||
...Array.from(new Array(secondaryCount).keys()).map(
|
||||
(i) =>
|
||||
`hsl(var(--vis-secondary-color) / ${1 - (1 / secondaryCount) * i})`,
|
||||
),
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user