@mantine/charts 7.12.2 → 7.13.0
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/cjs/AreaChart/AreaChart.cjs +3 -0
- package/cjs/AreaChart/AreaChart.cjs.map +1 -1
- package/cjs/BarChart/BarChart.cjs +6 -1
- package/cjs/BarChart/BarChart.cjs.map +1 -1
- package/cjs/CompositeChart/CompositeChart.cjs +393 -0
- package/cjs/CompositeChart/CompositeChart.cjs.map +1 -0
- package/cjs/LineChart/LineChart.cjs +3 -0
- package/cjs/LineChart/LineChart.cjs.map +1 -1
- package/cjs/PointLabel/PointLabel.cjs +23 -0
- package/cjs/PointLabel/PointLabel.cjs.map +1 -0
- package/cjs/ScatterChart/ScatterChart.cjs +7 -2
- package/cjs/ScatterChart/ScatterChart.cjs.map +1 -1
- package/cjs/index.cjs +2 -0
- package/cjs/index.cjs.map +1 -1
- package/esm/AreaChart/AreaChart.mjs +3 -0
- package/esm/AreaChart/AreaChart.mjs.map +1 -1
- package/esm/BarChart/BarChart.mjs +6 -2
- package/esm/BarChart/BarChart.mjs.map +1 -1
- package/esm/CompositeChart/CompositeChart.mjs +391 -0
- package/esm/CompositeChart/CompositeChart.mjs.map +1 -0
- package/esm/LineChart/LineChart.mjs +3 -0
- package/esm/LineChart/LineChart.mjs.map +1 -1
- package/esm/PointLabel/PointLabel.mjs +21 -0
- package/esm/PointLabel/PointLabel.mjs.map +1 -0
- package/esm/ScatterChart/ScatterChart.mjs +8 -3
- package/esm/ScatterChart/ScatterChart.mjs.map +1 -1
- package/esm/index.mjs +1 -0
- package/esm/index.mjs.map +1 -1
- package/lib/AreaChart/AreaChart.d.ts +2 -0
- package/lib/BarChart/BarChart.d.ts +6 -0
- package/lib/CompositeChart/CompositeChart.d.ts +62 -0
- package/lib/CompositeChart/index.d.ts +2 -0
- package/lib/LineChart/LineChart.d.ts +4 -2
- package/lib/PointLabel/PointLabel.d.ts +7 -0
- package/lib/ScatterChart/ScatterChart.d.ts +2 -0
- package/lib/index.d.mts +1 -0
- package/lib/index.d.ts +1 -0
- package/package.json +5 -5
package/esm/index.mjs
CHANGED
|
@@ -11,4 +11,5 @@ export { PieChart } from './PieChart/PieChart.mjs';
|
|
|
11
11
|
export { RadarChart } from './RadarChart/RadarChart.mjs';
|
|
12
12
|
export { ScatterChart } from './ScatterChart/ScatterChart.mjs';
|
|
13
13
|
export { BubbleChart } from './BubbleChart/BubbleChart.mjs';
|
|
14
|
+
export { CompositeChart } from './CompositeChart/CompositeChart.mjs';
|
|
14
15
|
//# sourceMappingURL=index.mjs.map
|
package/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
|
|
@@ -44,6 +44,8 @@ export interface AreaChartProps extends BoxProps, GridChartBaseProps, StylesApiP
|
|
|
44
44
|
children?: React.ReactNode;
|
|
45
45
|
/** Props passed down to recharts `Area` component */
|
|
46
46
|
areaProps?: ((series: AreaChartSeries) => Partial<Omit<AreaProps, 'ref'>>) | Partial<Omit<AreaProps, 'ref'>>;
|
|
47
|
+
/** Determines whether each point should have associated label, `false` by default */
|
|
48
|
+
withPointLabels?: boolean;
|
|
47
49
|
}
|
|
48
50
|
export type AreaChartFactory = Factory<{
|
|
49
51
|
props: AreaChartProps;
|
|
@@ -4,6 +4,7 @@ import { ChartLegendStylesNames } from '../ChartLegend';
|
|
|
4
4
|
import { ChartTooltipStylesNames } from '../ChartTooltip';
|
|
5
5
|
import type { BaseChartStylesNames, ChartSeries, GridChartBaseProps } from '../types';
|
|
6
6
|
export interface BarChartSeries extends ChartSeries {
|
|
7
|
+
stackId?: string;
|
|
7
8
|
}
|
|
8
9
|
export type BarChartType = 'default' | 'stacked' | 'percent' | 'waterfall';
|
|
9
10
|
export type BarChartStylesNames = 'bar' | BaseChartStylesNames | ChartLegendStylesNames | ChartTooltipStylesNames;
|
|
@@ -29,6 +30,10 @@ export interface BarChartProps extends BoxProps, GridChartBaseProps, StylesApiPr
|
|
|
29
30
|
barProps?: ((series: BarChartSeries) => Partial<Omit<BarProps, 'ref'>>) | Partial<Omit<BarProps, 'ref'>>;
|
|
30
31
|
/** Determines whether a label with bar value should be displayed on top of each bar, incompatible with `type="stacked"` and `type="percent"`, `false` by default */
|
|
31
32
|
withBarValueLabel?: boolean;
|
|
33
|
+
/** Sets minimum height of the bar in px, `0` by default */
|
|
34
|
+
minBarSize?: number;
|
|
35
|
+
/** Maximum bar width in px */
|
|
36
|
+
maxBarWidth?: number;
|
|
32
37
|
}
|
|
33
38
|
export type BarChartFactory = Factory<{
|
|
34
39
|
props: BarChartProps;
|
|
@@ -36,6 +41,7 @@ export type BarChartFactory = Factory<{
|
|
|
36
41
|
stylesNames: BarChartStylesNames;
|
|
37
42
|
vars: BarChartCssVariables;
|
|
38
43
|
}>;
|
|
44
|
+
export declare function BarLabel({ value, valueFormatter, ...others }: Record<string, any>): import("react/jsx-runtime").JSX.Element;
|
|
39
45
|
export declare const BarChart: import("@mantine/core").MantineComponent<{
|
|
40
46
|
props: BarChartProps;
|
|
41
47
|
ref: HTMLDivElement;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { AreaProps, BarProps, DotProps, LineProps, ComposedChart as ReChartsCompositeChart } from 'recharts';
|
|
2
|
+
import { BoxProps, ElementProps, Factory, StylesApiProps } from '@mantine/core';
|
|
3
|
+
import { ChartLegendStylesNames } from '../ChartLegend';
|
|
4
|
+
import { ChartTooltipStylesNames } from '../ChartTooltip';
|
|
5
|
+
import type { BaseChartStylesNames, ChartSeries, GridChartBaseProps } from '../types';
|
|
6
|
+
export type CompositeChartCurveType = 'bump' | 'linear' | 'natural' | 'monotone' | 'step' | 'stepBefore' | 'stepAfter';
|
|
7
|
+
export interface CompositeChartSeries extends ChartSeries {
|
|
8
|
+
type: 'line' | 'area' | 'bar';
|
|
9
|
+
strokeDasharray?: string | number;
|
|
10
|
+
}
|
|
11
|
+
export type CompositeChartStylesNames = 'line' | 'area' | 'bar' | BaseChartStylesNames | ChartLegendStylesNames | ChartTooltipStylesNames;
|
|
12
|
+
export type CompositeChartCssVariables = {
|
|
13
|
+
root: '--chart-text-color' | '--chart-grid-color';
|
|
14
|
+
};
|
|
15
|
+
export interface CompositeChartProps extends BoxProps, Omit<GridChartBaseProps, 'orientation'>, StylesApiProps<CompositeChartFactory>, ElementProps<'div'> {
|
|
16
|
+
/** Data used to display chart */
|
|
17
|
+
data: Record<string, any>[];
|
|
18
|
+
/** An array of objects with `name` and `color` keys. Determines which data should be consumed from the `data` array. */
|
|
19
|
+
series: CompositeChartSeries[];
|
|
20
|
+
/** Type of the curve, `'monotone'` by default */
|
|
21
|
+
curveType?: CompositeChartCurveType;
|
|
22
|
+
/** Determines whether dots should be displayed, `true` by default */
|
|
23
|
+
withDots?: boolean;
|
|
24
|
+
/** Props passed down to all dots. Ignored if `withDots={false}` is set. */
|
|
25
|
+
dotProps?: Omit<DotProps, 'ref'>;
|
|
26
|
+
/** Props passed down to all active dots. Ignored if `withDots={false}` is set. */
|
|
27
|
+
activeDotProps?: Omit<DotProps, 'ref'>;
|
|
28
|
+
/** Stroke width for the chart lines, `2` by default */
|
|
29
|
+
strokeWidth?: number;
|
|
30
|
+
/** Determines whether points with `null` values should be connected, `true` by default */
|
|
31
|
+
connectNulls?: boolean;
|
|
32
|
+
/** Additional components that are rendered inside recharts `AreaChart` component */
|
|
33
|
+
children?: React.ReactNode;
|
|
34
|
+
/** Props passed down to recharts `Line` component */
|
|
35
|
+
lineProps?: ((series: CompositeChartSeries) => Partial<Omit<LineProps, 'ref'>>) | Partial<Omit<LineProps, 'ref'>>;
|
|
36
|
+
/** Props passed down to recharts `Area` component */
|
|
37
|
+
areaProps?: ((series: CompositeChartSeries) => Partial<Omit<AreaProps, 'ref'>>) | Partial<Omit<AreaProps, 'ref'>>;
|
|
38
|
+
/** Props passed down to recharts `Bar` component */
|
|
39
|
+
barProps?: ((series: CompositeChartSeries) => Partial<Omit<BarProps, 'ref'>>) | Partial<Omit<BarProps, 'ref'>>;
|
|
40
|
+
/** Determines whether each point should have associated label, `false` by default */
|
|
41
|
+
withPointLabels?: boolean;
|
|
42
|
+
/** Determines whether a label with bar value should be displayed on top of each bar, incompatible with `type="stacked"` and `type="percent"`, `false` by default */
|
|
43
|
+
withBarValueLabel?: boolean;
|
|
44
|
+
/** Sets minimum height of the bar in px, `0` by default */
|
|
45
|
+
minBarSize?: number;
|
|
46
|
+
/** Maximum bar width in px */
|
|
47
|
+
maxBarWidth?: number;
|
|
48
|
+
/** Props passed down to recharts `AreaChart` component */
|
|
49
|
+
composedChartProps?: React.ComponentPropsWithoutRef<typeof ReChartsCompositeChart>;
|
|
50
|
+
}
|
|
51
|
+
export type CompositeChartFactory = Factory<{
|
|
52
|
+
props: CompositeChartProps;
|
|
53
|
+
ref: HTMLDivElement;
|
|
54
|
+
stylesNames: CompositeChartStylesNames;
|
|
55
|
+
vars: CompositeChartCssVariables;
|
|
56
|
+
}>;
|
|
57
|
+
export declare const CompositeChart: import("@mantine/core").MantineComponent<{
|
|
58
|
+
props: CompositeChartProps;
|
|
59
|
+
ref: HTMLDivElement;
|
|
60
|
+
stylesNames: CompositeChartStylesNames;
|
|
61
|
+
vars: CompositeChartCssVariables;
|
|
62
|
+
}>;
|
|
@@ -41,10 +41,12 @@ export interface LineChartProps extends BoxProps, GridChartBaseProps, StylesApiP
|
|
|
41
41
|
lineChartProps?: React.ComponentPropsWithoutRef<typeof ReChartsLineChart>;
|
|
42
42
|
/** Determines whether points with `null` values should be connected, `true` by default */
|
|
43
43
|
connectNulls?: boolean;
|
|
44
|
-
/** Additional components that are rendered inside recharts `
|
|
44
|
+
/** Additional components that are rendered inside recharts `LineChart` component */
|
|
45
45
|
children?: React.ReactNode;
|
|
46
|
-
/** Props passed down to recharts `
|
|
46
|
+
/** Props passed down to recharts `Line` component */
|
|
47
47
|
lineProps?: ((series: LineChartSeries) => Partial<Omit<LineProps, 'ref'>>) | Partial<Omit<LineProps, 'ref'>>;
|
|
48
|
+
/** Determines whether each point should have associated label, `false` by default */
|
|
49
|
+
withPointLabels?: boolean;
|
|
48
50
|
}
|
|
49
51
|
export type LineChartFactory = Factory<{
|
|
50
52
|
props: LineChartProps;
|
|
@@ -39,6 +39,8 @@ export interface ScatterChartProps extends Omit<GridChartBaseProps, 'dataKey' |
|
|
|
39
39
|
scatterChartProps?: React.ComponentPropsWithoutRef<typeof ReChartsScatterChart>;
|
|
40
40
|
/** Props passed down to recharts `Scatter` component */
|
|
41
41
|
scatterProps?: Omit<ScatterProps, 'ref'>;
|
|
42
|
+
/** If set, displays labels next to points for the given axis */
|
|
43
|
+
pointLabels?: 'x' | 'y';
|
|
42
44
|
}
|
|
43
45
|
export type ScatterChartFactory = Factory<{
|
|
44
46
|
props: ScatterChartProps;
|
package/lib/index.d.mts
CHANGED
package/lib/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mantine/charts",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.13.0",
|
|
4
4
|
"description": "Charts components built with recharts and Mantine",
|
|
5
5
|
"homepage": "https://mantine.dev/",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,15 +35,15 @@
|
|
|
35
35
|
"directory": "packages/@mantine/charts"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@mantine/core": "7.
|
|
39
|
-
"@mantine/hooks": "7.
|
|
38
|
+
"@mantine/core": "7.13.0",
|
|
39
|
+
"@mantine/hooks": "7.13.0",
|
|
40
40
|
"react": "^18.2.0",
|
|
41
41
|
"react-dom": "^18.2.0",
|
|
42
42
|
"recharts": "^2.10.3"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@mantine-tests/core": "1.1.0",
|
|
46
|
-
"@mantine/core": "7.
|
|
47
|
-
"@mantine/hooks": "7.
|
|
46
|
+
"@mantine/core": "7.13.0",
|
|
47
|
+
"@mantine/hooks": "7.13.0"
|
|
48
48
|
}
|
|
49
49
|
}
|