@mantine/charts 7.13.4 → 7.13.5-alpha.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.
Files changed (132) hide show
  1. package/package.json +7 -7
  2. package/styles.css +43 -0
  3. package/styles.layer.css +43 -0
  4. package/cjs/AreaChart/AreaChart.cjs +0 -388
  5. package/cjs/AreaChart/AreaChart.cjs.map +0 -1
  6. package/cjs/AreaChart/AreaGradient.cjs +0 -15
  7. package/cjs/AreaChart/AreaGradient.cjs.map +0 -1
  8. package/cjs/AreaChart/AreaSplit.cjs +0 -31
  9. package/cjs/AreaChart/AreaSplit.cjs.map +0 -1
  10. package/cjs/AreaChart/get-split-offset.cjs +0 -25
  11. package/cjs/AreaChart/get-split-offset.cjs.map +0 -1
  12. package/cjs/BarChart/BarChart.cjs +0 -374
  13. package/cjs/BarChart/BarChart.cjs.map +0 -1
  14. package/cjs/BubbleChart/BubbleChart.cjs +0 -148
  15. package/cjs/BubbleChart/BubbleChart.cjs.map +0 -1
  16. package/cjs/ChartLegend/ChartLegend.cjs +0 -97
  17. package/cjs/ChartLegend/ChartLegend.cjs.map +0 -1
  18. package/cjs/ChartLegend/ChartLegend.module.css.cjs +0 -7
  19. package/cjs/ChartLegend/ChartLegend.module.css.cjs.map +0 -1
  20. package/cjs/ChartTooltip/ChartTooltip.cjs +0 -124
  21. package/cjs/ChartTooltip/ChartTooltip.cjs.map +0 -1
  22. package/cjs/ChartTooltip/ChartTooltip.module.css.cjs +0 -7
  23. package/cjs/ChartTooltip/ChartTooltip.module.css.cjs.map +0 -1
  24. package/cjs/CompositeChart/CompositeChart.cjs +0 -393
  25. package/cjs/CompositeChart/CompositeChart.cjs.map +0 -1
  26. package/cjs/DonutChart/DonutChart.cjs +0 -149
  27. package/cjs/DonutChart/DonutChart.cjs.map +0 -1
  28. package/cjs/DonutChart/DonutChart.module.css.cjs +0 -7
  29. package/cjs/DonutChart/DonutChart.module.css.cjs.map +0 -1
  30. package/cjs/LineChart/LineChart.cjs +0 -353
  31. package/cjs/LineChart/LineChart.cjs.map +0 -1
  32. package/cjs/PieChart/PieChart.cjs +0 -175
  33. package/cjs/PieChart/PieChart.cjs.map +0 -1
  34. package/cjs/PieChart/PieChart.module.css.cjs +0 -7
  35. package/cjs/PieChart/PieChart.module.css.cjs.map +0 -1
  36. package/cjs/PointLabel/PointLabel.cjs +0 -23
  37. package/cjs/PointLabel/PointLabel.cjs.map +0 -1
  38. package/cjs/RadarChart/RadarChart.cjs +0 -113
  39. package/cjs/RadarChart/RadarChart.cjs.map +0 -1
  40. package/cjs/RadarChart/RadarChart.module.css.cjs +0 -7
  41. package/cjs/RadarChart/RadarChart.module.css.cjs.map +0 -1
  42. package/cjs/ScatterChart/ScatterChart.cjs +0 -287
  43. package/cjs/ScatterChart/ScatterChart.cjs.map +0 -1
  44. package/cjs/Sparkline/Sparkline.cjs +0 -103
  45. package/cjs/Sparkline/Sparkline.cjs.map +0 -1
  46. package/cjs/grid-chart.module.css.cjs +0 -7
  47. package/cjs/grid-chart.module.css.cjs.map +0 -1
  48. package/cjs/index.cjs +0 -36
  49. package/cjs/index.cjs.map +0 -1
  50. package/cjs/utils/get-series-labels/get-series-labels.cjs +0 -21
  51. package/cjs/utils/get-series-labels/get-series-labels.cjs.map +0 -1
  52. package/esm/AreaChart/AreaChart.mjs +0 -386
  53. package/esm/AreaChart/AreaChart.mjs.map +0 -1
  54. package/esm/AreaChart/AreaGradient.mjs +0 -13
  55. package/esm/AreaChart/AreaGradient.mjs.map +0 -1
  56. package/esm/AreaChart/AreaSplit.mjs +0 -29
  57. package/esm/AreaChart/AreaSplit.mjs.map +0 -1
  58. package/esm/AreaChart/get-split-offset.mjs +0 -22
  59. package/esm/AreaChart/get-split-offset.mjs.map +0 -1
  60. package/esm/BarChart/BarChart.mjs +0 -371
  61. package/esm/BarChart/BarChart.mjs.map +0 -1
  62. package/esm/BubbleChart/BubbleChart.mjs +0 -146
  63. package/esm/BubbleChart/BubbleChart.mjs.map +0 -1
  64. package/esm/ChartLegend/ChartLegend.mjs +0 -94
  65. package/esm/ChartLegend/ChartLegend.mjs.map +0 -1
  66. package/esm/ChartLegend/ChartLegend.module.css.mjs +0 -5
  67. package/esm/ChartLegend/ChartLegend.module.css.mjs.map +0 -1
  68. package/esm/ChartTooltip/ChartTooltip.mjs +0 -121
  69. package/esm/ChartTooltip/ChartTooltip.mjs.map +0 -1
  70. package/esm/ChartTooltip/ChartTooltip.module.css.mjs +0 -5
  71. package/esm/ChartTooltip/ChartTooltip.module.css.mjs.map +0 -1
  72. package/esm/CompositeChart/CompositeChart.mjs +0 -391
  73. package/esm/CompositeChart/CompositeChart.mjs.map +0 -1
  74. package/esm/DonutChart/DonutChart.mjs +0 -147
  75. package/esm/DonutChart/DonutChart.mjs.map +0 -1
  76. package/esm/DonutChart/DonutChart.module.css.mjs +0 -5
  77. package/esm/DonutChart/DonutChart.module.css.mjs.map +0 -1
  78. package/esm/LineChart/LineChart.mjs +0 -351
  79. package/esm/LineChart/LineChart.mjs.map +0 -1
  80. package/esm/PieChart/PieChart.mjs +0 -173
  81. package/esm/PieChart/PieChart.mjs.map +0 -1
  82. package/esm/PieChart/PieChart.module.css.mjs +0 -5
  83. package/esm/PieChart/PieChart.module.css.mjs.map +0 -1
  84. package/esm/PointLabel/PointLabel.mjs +0 -21
  85. package/esm/PointLabel/PointLabel.mjs.map +0 -1
  86. package/esm/RadarChart/RadarChart.mjs +0 -111
  87. package/esm/RadarChart/RadarChart.mjs.map +0 -1
  88. package/esm/RadarChart/RadarChart.module.css.mjs +0 -5
  89. package/esm/RadarChart/RadarChart.module.css.mjs.map +0 -1
  90. package/esm/ScatterChart/ScatterChart.mjs +0 -285
  91. package/esm/ScatterChart/ScatterChart.mjs.map +0 -1
  92. package/esm/Sparkline/Sparkline.mjs +0 -101
  93. package/esm/Sparkline/Sparkline.mjs.map +0 -1
  94. package/esm/grid-chart.module.css.mjs +0 -5
  95. package/esm/grid-chart.module.css.mjs.map +0 -1
  96. package/esm/index.mjs +0 -15
  97. package/esm/index.mjs.map +0 -1
  98. package/esm/utils/get-series-labels/get-series-labels.mjs +0 -19
  99. package/esm/utils/get-series-labels/get-series-labels.mjs.map +0 -1
  100. package/lib/AreaChart/AreaChart.d.ts +0 -61
  101. package/lib/AreaChart/AreaGradient.d.ts +0 -11
  102. package/lib/AreaChart/AreaSplit.d.ts +0 -12
  103. package/lib/AreaChart/get-split-offset.d.ts +0 -13
  104. package/lib/AreaChart/index.d.ts +0 -4
  105. package/lib/BarChart/BarChart.d.ts +0 -50
  106. package/lib/BarChart/index.d.ts +0 -2
  107. package/lib/BubbleChart/BubbleChart.d.ts +0 -53
  108. package/lib/BubbleChart/index.d.ts +0 -2
  109. package/lib/ChartLegend/ChartLegend.d.ts +0 -28
  110. package/lib/ChartLegend/index.d.ts +0 -2
  111. package/lib/ChartTooltip/ChartTooltip.d.ts +0 -32
  112. package/lib/ChartTooltip/index.d.ts +0 -2
  113. package/lib/CompositeChart/CompositeChart.d.ts +0 -62
  114. package/lib/CompositeChart/index.d.ts +0 -2
  115. package/lib/DonutChart/DonutChart.d.ts +0 -65
  116. package/lib/DonutChart/index.d.ts +0 -2
  117. package/lib/LineChart/LineChart.d.ts +0 -62
  118. package/lib/LineChart/index.d.ts +0 -2
  119. package/lib/PieChart/PieChart.d.ts +0 -66
  120. package/lib/PieChart/index.d.ts +0 -2
  121. package/lib/PointLabel/PointLabel.d.ts +0 -7
  122. package/lib/RadarChart/RadarChart.d.ts +0 -58
  123. package/lib/RadarChart/index.d.ts +0 -2
  124. package/lib/ScatterChart/ScatterChart.d.ts +0 -56
  125. package/lib/ScatterChart/index.d.ts +0 -2
  126. package/lib/Sparkline/Sparkline.d.ts +0 -44
  127. package/lib/Sparkline/index.d.ts +0 -2
  128. package/lib/index.d.mts +0 -13
  129. package/lib/index.d.ts +0 -13
  130. package/lib/types.d.ts +0 -69
  131. package/lib/utils/get-series-labels/get-series-labels.d.ts +0 -4
  132. package/lib/utils/index.d.ts +0 -1
@@ -1,56 +0,0 @@
1
- import { ScatterChart as ReChartsScatterChart, ScatterProps } from 'recharts';
2
- import { BoxProps, ElementProps, Factory, MantineColor, StylesApiProps } from '@mantine/core';
3
- import { ChartLegendStylesNames } from '../ChartLegend';
4
- import { ChartTooltipStylesNames } from '../ChartTooltip';
5
- import { BaseChartStylesNames, GridChartBaseProps } from '../types';
6
- export interface ScatterChartSeries {
7
- color: MantineColor;
8
- name: string;
9
- data: Record<string, number>[];
10
- }
11
- export type ScatterChartStylesNames = 'scatter' | BaseChartStylesNames | ChartLegendStylesNames | ChartTooltipStylesNames;
12
- export type ScatterChartCssVariables = {
13
- root: '--chart-text-color' | '--chart-grid-color';
14
- };
15
- export interface ScatterChartProps extends Omit<GridChartBaseProps, 'dataKey' | 'data' | 'unit' | 'valueFormatter'>, BoxProps, StylesApiProps<ScatterChartFactory>, ElementProps<'div'> {
16
- /** Keys that should be used to retrieve data from the data array on x and y axis */
17
- dataKey: {
18
- x: string;
19
- y: string;
20
- };
21
- /** Data that is used to build the chart */
22
- data: ScatterChartSeries[];
23
- /** Units displayed after value on axis and inside the tooltip */
24
- unit?: {
25
- x?: string;
26
- y?: string;
27
- };
28
- /** Labels that should be used instead of keys names in the tooltip */
29
- labels?: {
30
- x?: string;
31
- y?: string;
32
- };
33
- /** A function to format values on x/y axis and in the tooltip */
34
- valueFormatter?: GridChartBaseProps['valueFormatter'] | {
35
- x?: GridChartBaseProps['valueFormatter'];
36
- y?: GridChartBaseProps['valueFormatter'];
37
- };
38
- /** Props passed down to recharts `ScatterChart` component */
39
- scatterChartProps?: React.ComponentPropsWithoutRef<typeof ReChartsScatterChart>;
40
- /** Props passed down to recharts `Scatter` component */
41
- scatterProps?: Partial<Omit<ScatterProps, 'ref'>>;
42
- /** If set, displays labels next to points for the given axis */
43
- pointLabels?: 'x' | 'y';
44
- }
45
- export type ScatterChartFactory = Factory<{
46
- props: ScatterChartProps;
47
- ref: HTMLDivElement;
48
- stylesNames: ScatterChartStylesNames;
49
- vars: ScatterChartCssVariables;
50
- }>;
51
- export declare const ScatterChart: import("@mantine/core").MantineComponent<{
52
- props: ScatterChartProps;
53
- ref: HTMLDivElement;
54
- stylesNames: ScatterChartStylesNames;
55
- vars: ScatterChartCssVariables;
56
- }>;
@@ -1,2 +0,0 @@
1
- export { ScatterChart } from './ScatterChart';
2
- export type { ScatterChartProps, ScatterChartCssVariables, ScatterChartFactory, ScatterChartStylesNames, ScatterChartSeries, } from './ScatterChart';
@@ -1,44 +0,0 @@
1
- import { AreaProps } from 'recharts';
2
- import { BoxProps, ElementProps, Factory, MantineColor, StylesApiProps } from '@mantine/core';
3
- import { AreaChartCurveType } from '../AreaChart';
4
- export interface SparklineTrendColors {
5
- positive: MantineColor;
6
- negative: MantineColor;
7
- neutral?: MantineColor;
8
- }
9
- export type SparklineStylesNames = 'root';
10
- export type SparklineCssVariables = {
11
- root: '--chart-color';
12
- };
13
- export interface SparklineProps extends BoxProps, StylesApiProps<SparklineFactory>, ElementProps<'div'> {
14
- /** Data used to render the chart */
15
- data: (number | null)[];
16
- /** Key of `theme.colors` or any valid CSS color, `theme.primaryColor` by default */
17
- color?: MantineColor;
18
- /** Determines whether the chart fill should be a gradient, `true` by default */
19
- withGradient?: boolean;
20
- /** Controls fill opacity of the area, `0.6` by default */
21
- fillOpacity?: number;
22
- /** Type of the curve, `'linear'` by default */
23
- curveType?: AreaChartCurveType;
24
- /** Area stroke width, `2` by default */
25
- strokeWidth?: number;
26
- /** If set, `color` prop is ignored and chart color is determined by the difference between first and last value. */
27
- trendColors?: SparklineTrendColors;
28
- /** Determines whether null values should be connected with other values, `true` by default */
29
- connectNulls?: boolean;
30
- /** Props passed down to the underlying recharts `Area` component */
31
- areaProps?: Omit<AreaProps, 'data' | 'dataKey' | 'ref'>;
32
- }
33
- export type SparklineFactory = Factory<{
34
- props: SparklineProps;
35
- ref: HTMLDivElement;
36
- stylesNames: SparklineStylesNames;
37
- vars: SparklineCssVariables;
38
- }>;
39
- export declare const Sparkline: import("@mantine/core").MantineComponent<{
40
- props: SparklineProps;
41
- ref: HTMLDivElement;
42
- stylesNames: SparklineStylesNames;
43
- vars: SparklineCssVariables;
44
- }>;
@@ -1,2 +0,0 @@
1
- export { Sparkline } from './Sparkline';
2
- export type { SparklineCssVariables, SparklineFactory, SparklineProps, SparklineStylesNames, } from './Sparkline';
package/lib/index.d.mts DELETED
@@ -1,13 +0,0 @@
1
- export * from './ChartTooltip/index.js';
2
- export * from './ChartLegend/index.js';
3
- export * from './AreaChart/index.js';
4
- export * from './BarChart/index.js';
5
- export * from './LineChart/index.js';
6
- export * from './Sparkline/index.js';
7
- export * from './DonutChart/index.js';
8
- export * from './PieChart/index.js';
9
- export * from './RadarChart/index.js';
10
- export * from './ScatterChart/index.js';
11
- export * from './BubbleChart/index.js';
12
- export * from './CompositeChart/index.js';
13
- export * from './types';
package/lib/index.d.ts DELETED
@@ -1,13 +0,0 @@
1
- export * from './ChartTooltip/index.js';
2
- export * from './ChartLegend/index.js';
3
- export * from './AreaChart/index.js';
4
- export * from './BarChart/index.js';
5
- export * from './LineChart/index.js';
6
- export * from './Sparkline/index.js';
7
- export * from './DonutChart/index.js';
8
- export * from './PieChart/index.js';
9
- export * from './RadarChart/index.js';
10
- export * from './ScatterChart/index.js';
11
- export * from './BubbleChart/index.js';
12
- export * from './CompositeChart/index.js';
13
- export * from './types';
package/lib/types.d.ts DELETED
@@ -1,69 +0,0 @@
1
- import type { CartesianGridProps, LabelProps, LegendProps, ReferenceLineProps, TooltipProps, XAxisProps, YAxisProps } from 'recharts';
2
- import type { MantineColor } from '@mantine/core';
3
- export interface ChartReferenceLineProps extends Omit<ReferenceLineProps, 'ref' | 'label'> {
4
- color?: MantineColor;
5
- label?: string;
6
- labelPosition?: LabelProps['position'];
7
- }
8
- export interface ChartSeries {
9
- name: string;
10
- color?: MantineColor;
11
- label?: string;
12
- yAxisId?: string;
13
- }
14
- export type BaseChartStylesNames = 'root' | 'container' | 'axis' | 'grid' | 'referenceLine' | 'axisLabel';
15
- export type ChartData = Record<string, any>[];
16
- export interface GridChartBaseProps {
17
- /** Data used to display chart */
18
- data: ChartData;
19
- /** Key of the `data` object for x-axis values */
20
- dataKey: string;
21
- /** Reference lines that should be displayed on the chart */
22
- referenceLines?: ChartReferenceLineProps[];
23
- /** Determines whether x-axis should be displayed, `true` by default */
24
- withXAxis?: boolean;
25
- /** Determines whether y-axis should be displayed, `true` by default */
26
- withYAxis?: boolean;
27
- /** Props passed down to the `XAxis` recharts component */
28
- xAxisProps?: Omit<XAxisProps, 'ref'>;
29
- /** Props passed down to the `YAxis` recharts component */
30
- yAxisProps?: Omit<YAxisProps, 'ref'>;
31
- /** Props passed down to the `YAxis` recharts component rendered on the right side */
32
- rightYAxisProps?: Omit<YAxisProps, 'ref'>;
33
- /** Props passed down to the `CartesianGrid` component */
34
- gridProps?: Omit<CartesianGridProps, 'ref'>;
35
- /** Specifies which axis should have tick line, `'y'` by default */
36
- tickLine?: 'x' | 'y' | 'xy' | 'none';
37
- /** Dash array for the grid lines and cursor, `'5 5'` by default */
38
- strokeDasharray?: string | number;
39
- /** Specifies which lines should be displayed in the grid, `'x'` by default */
40
- gridAxis?: 'x' | 'y' | 'xy' | 'none';
41
- /** Unit displayed next to each tick in y-axis */
42
- unit?: string;
43
- /** Tooltip position animation duration in ms, `0` by default */
44
- tooltipAnimationDuration?: number;
45
- /** Props passed down to the `Legend` component */
46
- legendProps?: Omit<LegendProps, 'ref'>;
47
- /** Props passed down to the `Tooltip` component */
48
- tooltipProps?: Omit<TooltipProps<any, any>, 'ref'>;
49
- /** Determines whether chart legend should be displayed, `false` by default */
50
- withLegend?: boolean;
51
- /** Determines whether chart tooltip should be displayed, `true` by default */
52
- withTooltip?: boolean;
53
- /** Color of the text displayed inside the chart, `'dimmed'` by default */
54
- textColor?: MantineColor;
55
- /** Color of the grid and cursor lines, by default depends on color scheme */
56
- gridColor?: MantineColor;
57
- /** Chart orientation, `'horizontal'` by default */
58
- orientation?: 'horizontal' | 'vertical';
59
- /** A function to format values on Y axis and inside the tooltip */
60
- valueFormatter?: (value: number) => string;
61
- /** A label to display below the x-axis */
62
- xAxisLabel?: string;
63
- /** A label to display next to the y-axis */
64
- yAxisLabel?: string;
65
- /** A label to display next to the right y-axis */
66
- rightYAxisLabel?: string;
67
- /** Determines whether additional y-axis should be displayed on the right side of the chart, `false` by default */
68
- withRightYAxis?: boolean;
69
- }
@@ -1,4 +0,0 @@
1
- import { ChartSeries } from '../../types';
2
- type ChartSeriesLabels = Record<string, string | undefined>;
3
- export declare function getSeriesLabels(series: ChartSeries[] | undefined): ChartSeriesLabels;
4
- export {};
@@ -1 +0,0 @@
1
- export { getSeriesLabels } from './get-series-labels/get-series-labels';