@mantine-vue/charts 1.1.1

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.
Files changed (53) hide show
  1. package/cjs/index.cjs +822 -0
  2. package/cjs/index.cjs.map +1 -0
  3. package/esm/index.mjs +780 -0
  4. package/esm/index.mjs.map +1 -0
  5. package/lib/AreaChart/AreaChart.d.ts +2 -0
  6. package/lib/AreaChart/index.d.ts +1 -0
  7. package/lib/BarChart/BarChart.d.ts +2 -0
  8. package/lib/BarChart/index.d.ts +1 -0
  9. package/lib/BarsList/BarsList.d.ts +2 -0
  10. package/lib/BarsList/index.d.ts +1 -0
  11. package/lib/BubbleChart/BubbleChart.d.ts +2 -0
  12. package/lib/BubbleChart/index.d.ts +1 -0
  13. package/lib/ChartLegend/ChartLegend.d.ts +54 -0
  14. package/lib/ChartLegend/index.d.ts +2 -0
  15. package/lib/ChartTooltip/ChartTooltip.d.ts +48 -0
  16. package/lib/ChartTooltip/index.d.ts +2 -0
  17. package/lib/CompositeChart/CompositeChart.d.ts +2 -0
  18. package/lib/CompositeChart/index.d.ts +1 -0
  19. package/lib/DonutChart/DonutChart.d.ts +2 -0
  20. package/lib/DonutChart/index.d.ts +1 -0
  21. package/lib/FunnelChart/FunnelChart.d.ts +2 -0
  22. package/lib/FunnelChart/index.d.ts +1 -0
  23. package/lib/Heatmap/Heatmap.d.ts +2 -0
  24. package/lib/Heatmap/index.d.ts +1 -0
  25. package/lib/LineChart/LineChart.d.ts +2 -0
  26. package/lib/LineChart/index.d.ts +1 -0
  27. package/lib/PieChart/PieChart.d.ts +2 -0
  28. package/lib/PieChart/index.d.ts +1 -0
  29. package/lib/RadarChart/RadarChart.d.ts +2 -0
  30. package/lib/RadarChart/index.d.ts +1 -0
  31. package/lib/RadialBarChart/RadialBarChart.d.ts +2 -0
  32. package/lib/RadialBarChart/index.d.ts +1 -0
  33. package/lib/SankeyChart/SankeyChart.d.ts +2 -0
  34. package/lib/SankeyChart/index.d.ts +1 -0
  35. package/lib/ScatterChart/ScatterChart.d.ts +2 -0
  36. package/lib/ScatterChart/index.d.ts +1 -0
  37. package/lib/Sparkline/Sparkline.d.ts +2 -0
  38. package/lib/Sparkline/index.d.ts +1 -0
  39. package/lib/Treemap/Treemap.d.ts +2 -0
  40. package/lib/Treemap/index.d.ts +1 -0
  41. package/lib/charts.d.ts +319 -0
  42. package/lib/index.d.mts +6 -0
  43. package/lib/index.d.ts +6 -0
  44. package/lib/internal/colors.d.ts +1 -0
  45. package/lib/internal/component.d.ts +4 -0
  46. package/lib/internal/echarts.d.ts +1 -0
  47. package/lib/internal/options.d.ts +11 -0
  48. package/lib/types.d.ts +79 -0
  49. package/lib/utils/get-series-labels/get-series-labels.d.ts +2 -0
  50. package/lib/utils/index.d.ts +1 -0
  51. package/package.json +46 -0
  52. package/styles.css +12 -0
  53. package/styles.layer.css +14 -0
@@ -0,0 +1,319 @@
1
+ import type { MantineColor } from '@mantine-vue/core';
2
+ import type { DefineComponent, HTMLAttributes, VNodeChild } from 'vue';
3
+ import type { ChartData, ChartOptionProps, ChartRootProps, ChartSeries, GridChartBaseProps, MantineChartDotProps } from './types';
4
+ export type LineChartCurveType = 'bump' | 'linear' | 'natural' | 'monotone' | 'step' | 'stepBefore' | 'stepAfter';
5
+ export type AreaChartCurveType = LineChartCurveType;
6
+ export type CompositeChartCurveType = LineChartCurveType;
7
+ export interface LineChartSeries extends ChartSeries {
8
+ strokeDasharray?: string | number;
9
+ curveType?: LineChartCurveType;
10
+ }
11
+ export interface AreaChartSeries extends ChartSeries {
12
+ color: MantineColor;
13
+ strokeDasharray?: string | number;
14
+ curveType?: AreaChartCurveType;
15
+ }
16
+ export interface BarChartSeries extends ChartSeries {
17
+ stackId?: string;
18
+ }
19
+ export interface CompositeChartSeries extends ChartSeries {
20
+ type: 'line' | 'area' | 'bar';
21
+ strokeDasharray?: string | number;
22
+ }
23
+ export interface LineChartProps extends GridChartBaseProps {
24
+ series: LineChartSeries[];
25
+ type?: 'default' | 'gradient';
26
+ gradientStops?: {
27
+ offset: number;
28
+ color: MantineColor;
29
+ }[];
30
+ curveType?: LineChartCurveType;
31
+ fillOpacity?: number;
32
+ withDots?: boolean;
33
+ dotProps?: MantineChartDotProps;
34
+ activeDotProps?: MantineChartDotProps;
35
+ strokeWidth?: number;
36
+ lineChartProps?: ChartOptionProps;
37
+ connectNulls?: boolean;
38
+ lineProps?: ChartOptionProps | ((series: LineChartSeries) => ChartOptionProps);
39
+ withPointLabels?: boolean;
40
+ }
41
+ export interface AreaChartProps extends GridChartBaseProps {
42
+ series: AreaChartSeries[];
43
+ type?: 'default' | 'stacked' | 'percent' | 'split';
44
+ withGradient?: boolean;
45
+ curveType?: AreaChartCurveType;
46
+ withDots?: boolean;
47
+ dotProps?: MantineChartDotProps;
48
+ activeDotProps?: MantineChartDotProps;
49
+ strokeWidth?: number;
50
+ areaChartProps?: ChartOptionProps;
51
+ fillOpacity?: number;
52
+ splitColors?: [MantineColor, MantineColor];
53
+ splitOffset?: number;
54
+ connectNulls?: boolean;
55
+ areaProps?: ChartOptionProps | ((series: AreaChartSeries) => ChartOptionProps);
56
+ withPointLabels?: boolean;
57
+ }
58
+ export interface BarChartProps extends GridChartBaseProps {
59
+ series: BarChartSeries[];
60
+ type?: 'default' | 'stacked' | 'percent' | 'waterfall';
61
+ fillOpacity?: number;
62
+ cursorFill?: MantineColor;
63
+ barChartProps?: ChartOptionProps;
64
+ barProps?: ChartOptionProps | ((series: BarChartSeries) => ChartOptionProps);
65
+ withBarValueLabel?: boolean;
66
+ valueLabelProps?: ChartOptionProps | ((series: BarChartSeries) => ChartOptionProps);
67
+ minBarSize?: number;
68
+ maxBarWidth?: number;
69
+ barLabelColor?: MantineColor;
70
+ getBarColor?: (value: number, series: BarChartSeries) => MantineColor;
71
+ }
72
+ export interface CompositeChartProps extends Omit<GridChartBaseProps, 'orientation'> {
73
+ series: CompositeChartSeries[];
74
+ curveType?: CompositeChartCurveType;
75
+ withDots?: boolean;
76
+ dotProps?: MantineChartDotProps;
77
+ activeDotProps?: MantineChartDotProps;
78
+ strokeWidth?: number;
79
+ connectNulls?: boolean;
80
+ lineProps?: ChartOptionProps | ((series: CompositeChartSeries) => ChartOptionProps);
81
+ areaProps?: ChartOptionProps | ((series: CompositeChartSeries) => ChartOptionProps);
82
+ barProps?: ChartOptionProps | ((series: CompositeChartSeries) => ChartOptionProps);
83
+ withPointLabels?: boolean;
84
+ withBarValueLabel?: boolean;
85
+ minBarSize?: number;
86
+ maxBarWidth?: number;
87
+ composedChartProps?: ChartOptionProps;
88
+ }
89
+ export interface PieChartCell {
90
+ name: string;
91
+ value: number;
92
+ color?: MantineColor;
93
+ }
94
+ export interface PieChartProps extends ChartRootProps {
95
+ data: PieChartCell[];
96
+ withTooltip?: boolean;
97
+ withLabels?: boolean;
98
+ withLabelsLine?: boolean;
99
+ labelsPosition?: 'inside' | 'outside';
100
+ labelsType?: 'value' | 'percent';
101
+ tooltipDataSource?: 'segment' | 'all';
102
+ valueFormatter?: (value: number) => string;
103
+ strokeWidth?: number;
104
+ size?: number;
105
+ startAngle?: number;
106
+ endAngle?: number;
107
+ paddingAngle?: number;
108
+ pieProps?: ChartOptionProps;
109
+ tooltipProps?: ChartOptionProps;
110
+ }
111
+ export interface DonutChartProps extends PieChartProps {
112
+ thickness?: number;
113
+ chartLabel?: string;
114
+ chartLabelColor?: MantineColor;
115
+ chartLabelFontSize?: number;
116
+ chartLabelProps?: ChartOptionProps;
117
+ }
118
+ export interface ScatterChartSeries extends ChartSeries {
119
+ data?: ChartData;
120
+ }
121
+ export interface ScatterChartProps extends GridChartBaseProps {
122
+ data: ChartData;
123
+ series: ScatterChartSeries[];
124
+ xAxisKey?: string;
125
+ yAxisKey?: string;
126
+ scatterProps?: ChartOptionProps | ((series: ScatterChartSeries) => ChartOptionProps);
127
+ }
128
+ export interface BubbleChartProps extends ChartRootProps {
129
+ data: ChartData;
130
+ xAxisKey?: string;
131
+ yAxisKey?: string;
132
+ zAxisKey?: string;
133
+ name?: string;
134
+ color?: MantineColor;
135
+ range?: number;
136
+ withTooltip?: boolean;
137
+ withXAxis?: boolean;
138
+ withYAxis?: boolean;
139
+ xAxisProps?: ChartOptionProps;
140
+ yAxisProps?: ChartOptionProps;
141
+ tooltipProps?: ChartOptionProps;
142
+ gridProps?: ChartOptionProps;
143
+ valueFormatter?: (value: number) => string;
144
+ }
145
+ export interface RadarChartProps extends GridChartBaseProps {
146
+ series: ChartSeries[];
147
+ maxValue?: number;
148
+ withPolarGrid?: boolean;
149
+ withAngleAxis?: boolean;
150
+ withRadiusAxis?: boolean;
151
+ shape?: 'polygon' | 'circle';
152
+ radarProps?: ChartOptionProps;
153
+ }
154
+ export interface RadialBarChartCell {
155
+ name: string;
156
+ value: number;
157
+ color?: MantineColor;
158
+ }
159
+ export interface RadialBarChartProps extends ChartRootProps {
160
+ data: RadialBarChartCell[];
161
+ maxValue?: number;
162
+ withLabels?: boolean;
163
+ withLegend?: boolean;
164
+ withTooltip?: boolean;
165
+ startAngle?: number;
166
+ endAngle?: number;
167
+ barSize?: number;
168
+ radialBarProps?: ChartOptionProps;
169
+ tooltipProps?: ChartOptionProps;
170
+ legendProps?: ChartOptionProps;
171
+ }
172
+ export interface FunnelChartCell extends PieChartCell {
173
+ label?: string;
174
+ }
175
+ export interface FunnelChartProps extends ChartRootProps {
176
+ data: FunnelChartCell[];
177
+ withTooltip?: boolean;
178
+ withLabels?: boolean;
179
+ withLegend?: boolean;
180
+ valueFormatter?: (value: number) => string;
181
+ funnelProps?: ChartOptionProps;
182
+ tooltipProps?: ChartOptionProps;
183
+ }
184
+ export interface TreemapData {
185
+ name: string;
186
+ value?: number;
187
+ color?: MantineColor;
188
+ children?: TreemapData[];
189
+ }
190
+ export interface TreemapProps extends ChartRootProps {
191
+ data: TreemapData[];
192
+ withTooltip?: boolean;
193
+ withLegend?: boolean;
194
+ valueFormatter?: (value: number) => string;
195
+ treemapProps?: ChartOptionProps;
196
+ }
197
+ export interface SankeyChartNode {
198
+ name: string;
199
+ color?: MantineColor;
200
+ [key: string]: unknown;
201
+ }
202
+ export interface SankeyChartLink {
203
+ source: string | number;
204
+ target: string | number;
205
+ value: number;
206
+ [key: string]: unknown;
207
+ }
208
+ export interface SankeyChartProps extends ChartRootProps {
209
+ data?: SankeyChartNode[];
210
+ nodes?: SankeyChartNode[];
211
+ links: SankeyChartLink[];
212
+ withTooltip?: boolean;
213
+ valueFormatter?: (value: number) => string;
214
+ sankeyProps?: ChartOptionProps;
215
+ }
216
+ export interface SparklineTrendColors {
217
+ positive: MantineColor;
218
+ negative: MantineColor;
219
+ neutral?: MantineColor;
220
+ }
221
+ export interface SparklineProps extends ChartRootProps {
222
+ data: (number | null)[];
223
+ color?: MantineColor;
224
+ withGradient?: boolean;
225
+ fillOpacity?: number;
226
+ curveType?: LineChartCurveType;
227
+ strokeWidth?: number;
228
+ trendColors?: SparklineTrendColors;
229
+ connectNulls?: boolean;
230
+ areaProps?: ChartOptionProps;
231
+ }
232
+ export interface HeatmapRectData {
233
+ date: string;
234
+ value: number | null;
235
+ }
236
+ export interface HeatmapProps extends ChartRootProps {
237
+ data: Record<string, number>;
238
+ domain?: [number, number];
239
+ startDate?: Date | string;
240
+ endDate?: Date | string;
241
+ withMonthLabels?: boolean;
242
+ monthLabels?: string[];
243
+ withWeekdayLabels?: boolean;
244
+ weekdayLabels?: string[];
245
+ withOutsideDates?: boolean;
246
+ firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
247
+ rectSize?: number;
248
+ gap?: number;
249
+ rectRadius?: number;
250
+ colors?: string[];
251
+ weekdaysLabelsWidth?: number;
252
+ monthsLabelsHeight?: number;
253
+ fontSize?: number;
254
+ getTooltipLabel?: (input: HeatmapRectData) => VNodeChild;
255
+ withTooltip?: boolean;
256
+ tooltipProps?: ChartOptionProps;
257
+ getRectProps?: (input: HeatmapRectData) => Record<string, unknown>;
258
+ splitMonths?: boolean;
259
+ withLegend?: boolean;
260
+ legendLabels?: [string, string];
261
+ }
262
+ export interface BarsListBarData {
263
+ name: string;
264
+ value: number;
265
+ color?: MantineColor;
266
+ textColor?: MantineColor;
267
+ variant?: 'light' | 'filled';
268
+ }
269
+ export interface BarsListProps extends ChartRootProps {
270
+ data: BarsListBarData[];
271
+ valueFormatter?: (value: number) => string;
272
+ barsLabel?: string;
273
+ valueLabel?: string;
274
+ getBarProps?: (data: BarsListBarData) => HTMLAttributes;
275
+ renderBar?: (data: BarsListBarData, defaultBar: VNodeChild) => VNodeChild;
276
+ barGap?: string | number;
277
+ minBarSize?: string | number;
278
+ barHeight?: string | number;
279
+ barColor?: MantineColor;
280
+ barTextColor?: MantineColor;
281
+ autoContrast?: boolean;
282
+ }
283
+ type PublicComponent<P> = DefineComponent<P>;
284
+ export declare const AreaChart: PublicComponent<AreaChartProps>;
285
+ export declare const BarChart: PublicComponent<BarChartProps>;
286
+ export declare const LineChart: PublicComponent<LineChartProps>;
287
+ export declare const CompositeChart: PublicComponent<CompositeChartProps>;
288
+ export declare const PieChart: PublicComponent<PieChartProps>;
289
+ export declare const DonutChart: PublicComponent<DonutChartProps>;
290
+ export declare const ScatterChart: PublicComponent<ScatterChartProps>;
291
+ export declare const BubbleChart: PublicComponent<BubbleChartProps>;
292
+ export declare const RadarChart: PublicComponent<RadarChartProps>;
293
+ export declare const RadialBarChart: PublicComponent<RadialBarChartProps>;
294
+ export declare const FunnelChart: PublicComponent<FunnelChartProps>;
295
+ export declare const Treemap: PublicComponent<TreemapProps>;
296
+ export declare const SankeyChart: PublicComponent<SankeyChartProps>;
297
+ export declare const Sparkline: PublicComponent<SparklineProps>;
298
+ export declare const Heatmap: PublicComponent<HeatmapProps>;
299
+ export declare const BarsList: PublicComponent<BarsListProps>;
300
+ export type AreaChartStylesNames = 'area' | import('./types').BaseChartStylesNames | ChartLegendStylesNames | ChartTooltipStylesNames;
301
+ export type BarChartStylesNames = 'bar' | import('./types').BaseChartStylesNames | ChartLegendStylesNames | ChartTooltipStylesNames;
302
+ export type LineChartStylesNames = 'line' | import('./types').BaseChartStylesNames | ChartLegendStylesNames | ChartTooltipStylesNames;
303
+ export type CompositeChartStylesNames = 'line' | 'area' | 'bar' | import('./types').BaseChartStylesNames | ChartLegendStylesNames | ChartTooltipStylesNames;
304
+ export type PieChartStylesNames = 'root' | 'label';
305
+ export type DonutChartStylesNames = PieChartStylesNames;
306
+ export type ScatterChartStylesNames = import('./types').BaseChartStylesNames | ChartLegendStylesNames | ChartTooltipStylesNames;
307
+ export type BubbleChartStylesNames = ScatterChartStylesNames;
308
+ export type RadarChartStylesNames = 'root' | 'container' | 'axis' | 'grid' | 'curve' | ChartLegendStylesNames | ChartTooltipStylesNames;
309
+ export type RadialBarChartStylesNames = 'root' | 'container' | 'label' | ChartLegendStylesNames | ChartTooltipStylesNames;
310
+ export type FunnelChartStylesNames = 'root' | 'container' | 'label' | ChartLegendStylesNames | ChartTooltipStylesNames;
311
+ export type TreemapStylesNames = 'root' | 'container';
312
+ export type SankeyChartStylesNames = 'root' | 'container';
313
+ export type SparklineStylesNames = 'root';
314
+ export type HeatmapStylesNames = 'root' | 'rect' | 'weekdayLabel' | 'monthLabel' | 'legend' | 'legendLabel' | 'legendRect';
315
+ export type BarsListStylesNames = 'root' | 'bar' | 'barLabel' | 'barValue' | 'labelsRow';
316
+ export type ChartTooltipStylesNames = 'tooltip' | 'tooltipItem' | 'tooltipItemBody' | 'tooltipItemColor' | 'tooltipItemName' | 'tooltipItemData' | 'tooltipLabel' | 'tooltipBody';
317
+ export type ChartLegendStylesNames = 'legendItem' | 'legendItemColor' | 'legendItemName' | 'legend';
318
+ export type ChartCssVariables = Record<string, string>;
319
+ export {};
@@ -0,0 +1,6 @@
1
+ import './styles.css';
2
+ export * from './types';
3
+ export * from './charts';
4
+ export * from './ChartTooltip';
5
+ export * from './ChartLegend';
6
+ export * from './utils';
package/lib/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import './styles.css';
2
+ export * from './types';
3
+ export * from './charts';
4
+ export * from './ChartTooltip';
5
+ export * from './ChartLegend';
6
+ export * from './utils';
@@ -0,0 +1 @@
1
+ export declare function resolveColor(color: unknown, fallback?: string): string;
@@ -0,0 +1,4 @@
1
+ import { type Component } from 'vue';
2
+ import type { EChartsOption } from 'echarts';
3
+ export type OptionBuilder = (props: Record<string, unknown>) => EChartsOption;
4
+ export declare function createChartComponent(name: string, buildOption: OptionBuilder): Component;
@@ -0,0 +1 @@
1
+ export declare function registerECharts(): void;
@@ -0,0 +1,11 @@
1
+ import type { EChartsOption } from 'echarts';
2
+ type Props = Record<string, unknown>;
3
+ export declare function cartesianOption(props: Props, kind: 'line' | 'area' | 'bar' | 'composite'): EChartsOption;
4
+ export declare function radialOption(props: Props, donut?: boolean): EChartsOption;
5
+ export declare function scatterOption(props: Props, bubble?: boolean): EChartsOption;
6
+ export declare function sparklineOption(props: Props): EChartsOption;
7
+ export declare function radarOption(props: Props): EChartsOption;
8
+ export declare function simpleOption(type: 'funnel' | 'treemap' | 'sankey', props: Props): EChartsOption;
9
+ export declare function radialBarOption(props: Props): EChartsOption;
10
+ export declare function heatmapOption(props: Props): EChartsOption;
11
+ export {};
package/lib/types.d.ts ADDED
@@ -0,0 +1,79 @@
1
+ import type { CSSProperties, HTMLAttributes, VNodeChild } from 'vue';
2
+ import type { EChartsOption } from 'echarts';
3
+ import type { MantineColor } from '@mantine-vue/core';
4
+ export type ChartDataItem = Record<string, unknown>;
5
+ export type ChartData = ChartDataItem[];
6
+ export type ChartOptionProps = Record<string, unknown>;
7
+ export interface ChartSeries {
8
+ name: string;
9
+ color?: MantineColor;
10
+ label?: string;
11
+ yAxisId?: string;
12
+ }
13
+ export interface ChartReferenceLineProps {
14
+ x?: string | number;
15
+ y?: string | number;
16
+ color?: MantineColor;
17
+ label?: string | Record<string, unknown>;
18
+ labelPosition?: string;
19
+ strokeDasharray?: string | number;
20
+ [key: string]: unknown;
21
+ }
22
+ export type BaseChartStylesNames = 'root' | 'container' | 'axis' | 'grid' | 'referenceLine' | 'axisLabel';
23
+ export interface ChartRootProps {
24
+ class?: HTMLAttributes['class'];
25
+ className?: string;
26
+ style?: CSSProperties | string;
27
+ id?: string;
28
+ dir?: 'ltr' | 'rtl' | 'auto';
29
+ height?: string | number;
30
+ width?: string | number;
31
+ option?: EChartsOption;
32
+ loading?: boolean;
33
+ autoresize?: boolean;
34
+ /** ECharts renderer used to draw the chart. @default 'canvas' */
35
+ renderer?: 'canvas' | 'svg';
36
+ /** Additional options passed to `echarts.init`. */
37
+ initOptions?: Record<string, unknown>;
38
+ }
39
+ export interface GridChartBaseProps extends ChartRootProps {
40
+ data: ChartData;
41
+ dataKey: string;
42
+ referenceLines?: ChartReferenceLineProps[];
43
+ withXAxis?: boolean;
44
+ withYAxis?: boolean;
45
+ xAxisProps?: ChartOptionProps;
46
+ yAxisProps?: ChartOptionProps;
47
+ rightYAxisProps?: ChartOptionProps;
48
+ gridProps?: ChartOptionProps;
49
+ tickLine?: 'x' | 'y' | 'xy' | 'none';
50
+ strokeDasharray?: string | number;
51
+ gridAxis?: 'x' | 'y' | 'xy' | 'none';
52
+ unit?: string;
53
+ tooltipAnimationDuration?: number;
54
+ legendProps?: ChartOptionProps;
55
+ tooltipProps?: ChartOptionProps;
56
+ withLegend?: boolean;
57
+ withTooltip?: boolean;
58
+ textColor?: MantineColor;
59
+ gridColor?: MantineColor;
60
+ orientation?: 'horizontal' | 'vertical';
61
+ valueFormatter?: (value: number) => string;
62
+ xAxisLabel?: string;
63
+ yAxisLabel?: string;
64
+ rightYAxisLabel?: string;
65
+ withRightYAxis?: boolean;
66
+ }
67
+ export interface MantineChartDotProps extends ChartOptionProps {
68
+ strokeWidth?: number;
69
+ }
70
+ export interface ChartTooltipPayload {
71
+ name?: string;
72
+ dataKey?: string;
73
+ value?: unknown;
74
+ color?: string;
75
+ unit?: string;
76
+ payload?: ChartDataItem;
77
+ [key: string]: unknown;
78
+ }
79
+ export type ChartRenderable = VNodeChild | string | number | null | undefined;
@@ -0,0 +1,2 @@
1
+ import type { ChartSeries } from '../../types';
2
+ export declare function getSeriesLabels(series: ChartSeries[] | undefined): Record<string, string>;
@@ -0,0 +1 @@
1
+ export { getSeriesLabels } from './get-series-labels/get-series-labels';
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@mantine-vue/charts",
3
+ "version": "1.1.1",
4
+ "description": "Charts components built with Apache ECharts and Mantine Vue",
5
+ "license": "MIT",
6
+ "files": [
7
+ "cjs",
8
+ "esm",
9
+ "lib",
10
+ "styles.css",
11
+ "styles.layer.css",
12
+ "styles"
13
+ ],
14
+ "sideEffects": [
15
+ "*.css"
16
+ ],
17
+ "main": "./cjs/index.cjs",
18
+ "module": "./esm/index.mjs",
19
+ "types": "./lib/index.d.ts",
20
+ "exports": {
21
+ ".": {
22
+ "import": {
23
+ "types": "./lib/index.d.mts",
24
+ "default": "./esm/index.mjs"
25
+ },
26
+ "require": {
27
+ "types": "./lib/index.d.ts",
28
+ "default": "./cjs/index.cjs"
29
+ }
30
+ },
31
+ "./styles.css": "./styles.css",
32
+ "./styles.layer.css": "./styles.layer.css"
33
+ },
34
+ "devDependencies": {
35
+ "@mantine-vue/core": "workspace:*",
36
+ "echarts": "^6.0.0",
37
+ "vue": "^3.5.0",
38
+ "vue-echarts": "^8.0.1"
39
+ },
40
+ "peerDependencies": {
41
+ "@mantine-vue/core": "1.1.1",
42
+ "echarts": ">=6.0.0",
43
+ "vue": "^3.5.0",
44
+ "vue-echarts": ">=8.0.0"
45
+ }
46
+ }
package/styles.css ADDED
@@ -0,0 +1,12 @@
1
+ .mantine-Chart-root { position: relative; color: var(--mantine-color-text); font-family: var(--mantine-font-family); }
2
+ .mantine-Chart-container { width: 100%; height: 100%; }
3
+ .mantine-ChartTooltip-tooltip { min-width: 150px; padding: 8px 12px; border: 1px solid var(--mantine-color-default-border); border-radius: var(--mantine-radius-default); background: var(--mantine-color-body); box-shadow: var(--mantine-shadow-md); color: var(--mantine-color-text); font-size: var(--mantine-font-size-sm); }
4
+ .mantine-ChartTooltip-tooltipLabel { margin-bottom: 4px; font-weight: 500; }
5
+ .mantine-ChartTooltip-tooltipBody { display: flex; flex-direction: column; gap: 4px; }
6
+ .mantine-ChartTooltip-tooltipItem { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
7
+ .mantine-ChartTooltip-tooltipItemBody { display: flex; align-items: center; gap: 8px; }
8
+ .mantine-ChartTooltip-tooltipItemColor, .mantine-ChartLegend-legendItemColor { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
9
+ .mantine-ChartTooltip-tooltipItemData { font-variant-numeric: tabular-nums; font-weight: 500; }
10
+ .mantine-ChartLegend-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--mantine-color-dimmed); font-size: var(--mantine-font-size-sm); }
11
+ .mantine-ChartLegend-legend[data-centered] { justify-content: center; }
12
+ .mantine-ChartLegend-legendItem { display: flex; align-items: center; gap: 6px; cursor: default; }
@@ -0,0 +1,14 @@
1
+ @layer mantine {
2
+ .mantine-Chart-root { position: relative; color: var(--mantine-color-text); font-family: var(--mantine-font-family); }
3
+ .mantine-Chart-container { width: 100%; height: 100%; }
4
+ .mantine-ChartTooltip-tooltip { min-width: 150px; padding: 8px 12px; border: 1px solid var(--mantine-color-default-border); border-radius: var(--mantine-radius-default); background: var(--mantine-color-body); box-shadow: var(--mantine-shadow-md); color: var(--mantine-color-text); font-size: var(--mantine-font-size-sm); }
5
+ .mantine-ChartTooltip-tooltipLabel { margin-bottom: 4px; font-weight: 500; }
6
+ .mantine-ChartTooltip-tooltipBody { display: flex; flex-direction: column; gap: 4px; }
7
+ .mantine-ChartTooltip-tooltipItem { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
8
+ .mantine-ChartTooltip-tooltipItemBody { display: flex; align-items: center; gap: 8px; }
9
+ .mantine-ChartTooltip-tooltipItemColor, .mantine-ChartLegend-legendItemColor { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
10
+ .mantine-ChartTooltip-tooltipItemData { font-variant-numeric: tabular-nums; font-weight: 500; }
11
+ .mantine-ChartLegend-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--mantine-color-dimmed); font-size: var(--mantine-font-size-sm); }
12
+ .mantine-ChartLegend-legend[data-centered] { justify-content: center; }
13
+ .mantine-ChartLegend-legendItem { display: flex; align-items: center; gap: 6px; cursor: default; }
14
+ }