@alfalab/core-components-chart 3.3.3 → 3.4.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.
- package/Component.js +1 -1
- package/components/Dot/index.css +8 -8
- package/components/Dot/index.js +1 -1
- package/components/Legends/index.css +12 -11
- package/components/Legends/index.js +1 -1
- package/components/Tick/index.css +4 -4
- package/components/Tick/index.js +1 -1
- package/components/TooltipContent/index.css +18 -14
- package/components/TooltipContent/index.js +1 -1
- package/cssm/components/Legends/index.module.css +4 -3
- package/cssm/components/TooltipContent/index.module.css +11 -7
- package/esm/Component.js +1 -1
- package/esm/components/Dot/index.css +8 -8
- package/esm/components/Dot/index.js +1 -1
- package/esm/components/Legends/index.css +12 -11
- package/esm/components/Legends/index.js +1 -1
- package/esm/components/Tick/index.css +4 -4
- package/esm/components/Tick/index.js +1 -1
- package/esm/components/TooltipContent/index.css +18 -14
- package/esm/components/TooltipContent/index.js +1 -1
- package/esm/index.css +5 -5
- package/index.css +5 -5
- package/modern/Component.js +1 -1
- package/modern/components/Dot/index.css +8 -8
- package/modern/components/Dot/index.js +1 -1
- package/modern/components/Legends/index.css +12 -11
- package/modern/components/Legends/index.js +1 -1
- package/modern/components/Tick/index.css +4 -4
- package/modern/components/Tick/index.js +1 -1
- package/modern/components/TooltipContent/index.css +18 -14
- package/modern/components/TooltipContent/index.js +1 -1
- package/modern/index.css +5 -5
- package/moderncssm/Component.d.ts +8 -0
- package/moderncssm/Component.js +251 -0
- package/moderncssm/components/CustomizedLabel.d.ts +4 -0
- package/moderncssm/components/CustomizedLabel.js +11 -0
- package/moderncssm/components/Dot/index.d.ts +5 -0
- package/moderncssm/components/Dot/index.js +43 -0
- package/moderncssm/components/Dot/index.module.css +22 -0
- package/moderncssm/components/Legends/index.d.ts +14 -0
- package/moderncssm/components/Legends/index.js +36 -0
- package/moderncssm/components/Legends/index.module.css +36 -0
- package/moderncssm/components/LinearGradient.d.ts +5 -0
- package/moderncssm/components/LinearGradient.js +5 -0
- package/moderncssm/components/RectBar.d.ts +3 -0
- package/moderncssm/components/RectBar.js +27 -0
- package/moderncssm/components/Tick/index.d.ts +5 -0
- package/moderncssm/components/Tick/index.js +16 -0
- package/moderncssm/components/Tick/index.module.css +18 -0
- package/moderncssm/components/TooltipContent/index.d.ts +11 -0
- package/moderncssm/components/TooltipContent/index.js +26 -0
- package/moderncssm/components/TooltipContent/index.module.css +51 -0
- package/moderncssm/hooks/usePathBar/index.d.ts +14 -0
- package/moderncssm/hooks/usePathBar/index.js +37 -0
- package/moderncssm/hooks/usePathBar/utils/getRadius.d.ts +2 -0
- package/moderncssm/hooks/usePathBar/utils/getRadius.js +6 -0
- package/moderncssm/hooks/useSettings/index.d.ts +19 -0
- package/moderncssm/hooks/useSettings/index.js +43 -0
- package/moderncssm/hooks/useSettings/utils/setComposedChartsMargin.d.ts +12 -0
- package/moderncssm/hooks/useSettings/utils/setComposedChartsMargin.js +12 -0
- package/moderncssm/hooks/useSettings/utils/setDatas.d.ts +5 -0
- package/moderncssm/hooks/useSettings/utils/setDatas.js +32 -0
- package/moderncssm/hooks/useSettings/utils/setGradientCharts.d.ts +3 -0
- package/moderncssm/hooks/useSettings/utils/setGradientCharts.js +35 -0
- package/moderncssm/hooks/useSettings/utils/setLegendMargin.d.ts +4 -0
- package/moderncssm/hooks/useSettings/utils/setLegendMargin.js +14 -0
- package/moderncssm/hooks/useSettings/utils/sortByIndex.d.ts +3 -0
- package/moderncssm/hooks/useSettings/utils/sortByIndex.js +8 -0
- package/moderncssm/icons/Circle.d.ts +8 -0
- package/moderncssm/icons/Circle.js +6 -0
- package/moderncssm/icons/CircleLine.d.ts +8 -0
- package/moderncssm/icons/CircleLine.js +7 -0
- package/moderncssm/icons/FilledCircle.d.ts +8 -0
- package/moderncssm/icons/FilledCircle.js +10 -0
- package/moderncssm/icons/Point.d.ts +8 -0
- package/moderncssm/icons/Point.js +7 -0
- package/moderncssm/icons/StrokeCircle.d.ts +8 -0
- package/moderncssm/icons/StrokeCircle.js +6 -0
- package/moderncssm/index.d.ts +2 -0
- package/moderncssm/index.js +1 -0
- package/moderncssm/index.module.css +19 -0
- package/moderncssm/types/brush.types.d.ts +41 -0
- package/moderncssm/types/brush.types.js +1 -0
- package/moderncssm/types/cartesianGrid.types.d.ts +23 -0
- package/moderncssm/types/cartesianGrid.types.js +1 -0
- package/moderncssm/types/chart.types.d.ts +61 -0
- package/moderncssm/types/chart.types.js +1 -0
- package/moderncssm/types/composedChart.types.d.ts +33 -0
- package/moderncssm/types/composedChart.types.js +1 -0
- package/moderncssm/types/index.d.ts +14 -0
- package/moderncssm/types/index.js +1 -0
- package/moderncssm/types/labelList.types.d.ts +5 -0
- package/moderncssm/types/labelList.types.js +1 -0
- package/moderncssm/types/legend.types.d.ts +30 -0
- package/moderncssm/types/legend.types.js +1 -0
- package/moderncssm/types/options.types.d.ts +59 -0
- package/moderncssm/types/options.types.js +1 -0
- package/moderncssm/types/payload.types.d.ts +29 -0
- package/moderncssm/types/payload.types.js +1 -0
- package/moderncssm/types/responsiveContainer.types.d.ts +10 -0
- package/moderncssm/types/responsiveContainer.types.js +1 -0
- package/moderncssm/types/seria.types.d.ts +72 -0
- package/moderncssm/types/seria.types.js +1 -0
- package/moderncssm/types/tooltip.types.d.ts +70 -0
- package/moderncssm/types/tooltip.types.js +1 -0
- package/moderncssm/types/utils/axis.types.d.ts +68 -0
- package/moderncssm/types/utils/axis.types.js +1 -0
- package/moderncssm/types/utils/coordinates.types.d.ts +11 -0
- package/moderncssm/types/utils/coordinates.types.js +1 -0
- package/moderncssm/types/utils/data.types.d.ts +17 -0
- package/moderncssm/types/utils/data.types.js +1 -0
- package/moderncssm/types/utils/dot.types.d.ts +73 -0
- package/moderncssm/types/utils/dot.types.js +1 -0
- package/moderncssm/types/utils/gradient.types.d.ts +29 -0
- package/moderncssm/types/utils/gradient.types.js +1 -0
- package/moderncssm/types/utils/index.d.ts +7 -0
- package/moderncssm/types/utils/index.js +1 -0
- package/moderncssm/types/utils/tick.types.d.ts +19 -0
- package/moderncssm/types/utils/tick.types.js +1 -0
- package/moderncssm/types/xAxis.types.d.ts +16 -0
- package/moderncssm/types/xAxis.types.js +1 -0
- package/moderncssm/types/yAxis.types.d.ts +8 -0
- package/moderncssm/types/yAxis.types.js +1 -0
- package/package.json +4 -4
- package/src/components/Legends/index.module.css +4 -4
- package/src/components/Tick/index.module.css +1 -1
- package/src/components/TooltipContent/index.module.css +7 -7
- package/src/index.module.css +1 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BrushProps } from "./brush.types";
|
|
4
|
+
import { CartesianGridProps } from "./cartesianGrid.types";
|
|
5
|
+
import { ComposedChartProps } from "./composedChart.types";
|
|
6
|
+
import { LegendProps } from "./legend.types";
|
|
7
|
+
import { ResponsiveContainerProps } from "./responsiveContainer.types";
|
|
8
|
+
import { SeriaProps } from "./seria.types";
|
|
9
|
+
import { TooltipProps } from "./tooltip.types";
|
|
10
|
+
import { XAxisProps } from "./xAxis.types";
|
|
11
|
+
import { YAxisProps } from "./yAxis.types";
|
|
12
|
+
interface OptionsProps {
|
|
13
|
+
/**
|
|
14
|
+
* Индефикатор графика
|
|
15
|
+
*/
|
|
16
|
+
id: string;
|
|
17
|
+
/**
|
|
18
|
+
* Компонент контейнера, позволяющий адаптировать диаграммы к размеру родительского контейнера
|
|
19
|
+
*/
|
|
20
|
+
responsiveContainer?: ResponsiveContainerProps;
|
|
21
|
+
/**
|
|
22
|
+
* Диаграмма, состоящая из bar, linear и area диаграмм
|
|
23
|
+
*/
|
|
24
|
+
composeChart: ComposedChartProps;
|
|
25
|
+
/**
|
|
26
|
+
* Отображение линий осей графика
|
|
27
|
+
*/
|
|
28
|
+
cartesianGrid?: CartesianGridProps;
|
|
29
|
+
/**
|
|
30
|
+
* Настройки оси Х
|
|
31
|
+
*/
|
|
32
|
+
xAxis: XAxisProps;
|
|
33
|
+
/**
|
|
34
|
+
* Настройки оси У
|
|
35
|
+
*/
|
|
36
|
+
yAxis: YAxisProps;
|
|
37
|
+
/**
|
|
38
|
+
* Всплывающаяся подсказка
|
|
39
|
+
*/
|
|
40
|
+
tooltip?: TooltipProps;
|
|
41
|
+
/**
|
|
42
|
+
* Компонент маштабирования графика
|
|
43
|
+
*/
|
|
44
|
+
brush?: BrushProps;
|
|
45
|
+
/**
|
|
46
|
+
* Компонент подписи графиков
|
|
47
|
+
*/
|
|
48
|
+
legend?: LegendProps;
|
|
49
|
+
/**
|
|
50
|
+
* Mассив объектов с параметрами грaфиков с обязательным полем
|
|
51
|
+
*/
|
|
52
|
+
series: SeriaProps[];
|
|
53
|
+
/**
|
|
54
|
+
* Mассив меток
|
|
55
|
+
*/
|
|
56
|
+
labels: Array<string | number>;
|
|
57
|
+
children?: React.ReactNode;
|
|
58
|
+
}
|
|
59
|
+
export { OptionsProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DataDynamicBooleanProps } from "./utils/data.types";
|
|
3
|
+
interface PayloadProps {
|
|
4
|
+
/**
|
|
5
|
+
* Цвет графика
|
|
6
|
+
*/
|
|
7
|
+
color: string;
|
|
8
|
+
/**
|
|
9
|
+
* Ключ графика
|
|
10
|
+
*/
|
|
11
|
+
dataKey: string;
|
|
12
|
+
/**
|
|
13
|
+
* Форматирование значения графика
|
|
14
|
+
*/
|
|
15
|
+
formatter: (value: number | string) => React.ReactText;
|
|
16
|
+
/**
|
|
17
|
+
* Имя графика
|
|
18
|
+
*/
|
|
19
|
+
name: string;
|
|
20
|
+
/**
|
|
21
|
+
* Полезная нагрузка
|
|
22
|
+
*/
|
|
23
|
+
payload: DataDynamicBooleanProps;
|
|
24
|
+
/**
|
|
25
|
+
* Значение графика
|
|
26
|
+
*/
|
|
27
|
+
value: number;
|
|
28
|
+
}
|
|
29
|
+
export { PayloadProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { DataProps } from "./utils/data.types";
|
|
2
|
+
import { GradientProps } from "./utils/gradient.types";
|
|
3
|
+
import { ChartProps } from "./chart.types";
|
|
4
|
+
import { LabelListProps } from "./labelList.types";
|
|
5
|
+
type RadiusProp = {
|
|
6
|
+
top?: number;
|
|
7
|
+
bottom?: number;
|
|
8
|
+
};
|
|
9
|
+
interface SeriaProps {
|
|
10
|
+
/**
|
|
11
|
+
* Скрыть график
|
|
12
|
+
*/
|
|
13
|
+
hide?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Скрыть график в легенде
|
|
16
|
+
*/
|
|
17
|
+
hideLegend?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Скрыть график в тултипe
|
|
20
|
+
*/
|
|
21
|
+
hideTooltip?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Z-index графика
|
|
24
|
+
*/
|
|
25
|
+
zIndex?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Тип графика
|
|
28
|
+
*/
|
|
29
|
+
chart: 'line' | 'area' | 'bar' | 'gradient';
|
|
30
|
+
/**
|
|
31
|
+
* Радиус закругления углов графика типа bar
|
|
32
|
+
*/
|
|
33
|
+
radius?: RadiusProp;
|
|
34
|
+
/**
|
|
35
|
+
* Тип иконки для графика
|
|
36
|
+
*/
|
|
37
|
+
icon: 'circleLine' | 'filledCircle' | 'strokeCircle' | 'circle';
|
|
38
|
+
/**
|
|
39
|
+
* Оффсет для градиента (только для типа area)
|
|
40
|
+
*/
|
|
41
|
+
offset: number;
|
|
42
|
+
/**
|
|
43
|
+
* Заливка графика
|
|
44
|
+
*/
|
|
45
|
+
fill?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Прозрачность
|
|
48
|
+
*/
|
|
49
|
+
gradient: {
|
|
50
|
+
/**
|
|
51
|
+
* Индефикатор градиента
|
|
52
|
+
*/
|
|
53
|
+
gid: string;
|
|
54
|
+
/**
|
|
55
|
+
* Параметра точек для градиента
|
|
56
|
+
*/
|
|
57
|
+
points: GradientProps[];
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Параметры labels для графика типа bar
|
|
61
|
+
*/
|
|
62
|
+
labelList?: LabelListProps;
|
|
63
|
+
/**
|
|
64
|
+
* Параметры графика
|
|
65
|
+
*/
|
|
66
|
+
properties: ChartProps;
|
|
67
|
+
/**
|
|
68
|
+
* Данные для построения графика
|
|
69
|
+
*/
|
|
70
|
+
data: DataProps[];
|
|
71
|
+
}
|
|
72
|
+
export { RadiusProp, SeriaProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ReactElement, ReactText, SVGProps } from 'react';
|
|
2
|
+
import { AnimationTiming } from 'recharts/types/util/types';
|
|
3
|
+
interface TooltipProps {
|
|
4
|
+
/**
|
|
5
|
+
* Разделитель между именем и значением.
|
|
6
|
+
*/
|
|
7
|
+
separator?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Размер смещения между положением всплывающей подсказки и активной позицией.
|
|
10
|
+
*/
|
|
11
|
+
offset?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Когда элемент полезной нагрузки имеет значение null или undefined, этот элемент не отображается.
|
|
14
|
+
*/
|
|
15
|
+
filterNull?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Если установлено false, курсор не будет отображаться, когда всплывающая подсказка активна.
|
|
18
|
+
* Если установлен объект, опция - это конфигурация курсора.
|
|
19
|
+
* Если установлен элемент React, опция является настраиваемым элементом реакции курсора рисования.
|
|
20
|
+
*/
|
|
21
|
+
cursor?: boolean | ReactElement | SVGProps<SVGElement>;
|
|
22
|
+
/**
|
|
23
|
+
* Если это поле установлено, положение всплывающей подсказки будет фиксированным и больше не будет перемещаться.
|
|
24
|
+
*/
|
|
25
|
+
position?: {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Если установлено false, анимация всплывающей подсказки будет отключена.
|
|
31
|
+
*/
|
|
32
|
+
isAnimationActive?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Указывает, когда должна начинаться анимация, единица измерения этого параметра - мс.
|
|
35
|
+
*/
|
|
36
|
+
animationBegin?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Определяет продолжительность анимации, единица измерения этого параметра - мс.
|
|
39
|
+
*/
|
|
40
|
+
animationDuration?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Тип функции плавности.
|
|
43
|
+
*/
|
|
44
|
+
animationEasing?: AnimationTiming;
|
|
45
|
+
/**
|
|
46
|
+
* Отображение стрелки тултипа
|
|
47
|
+
*/
|
|
48
|
+
arrow: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Высчитывается автоматичекси, направление стрелки
|
|
51
|
+
*/
|
|
52
|
+
tooltipArrowSide?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Функция форматирования метки во всплывающей подсказке.
|
|
55
|
+
*/
|
|
56
|
+
labelFormatter?: (value: any) => ReactText;
|
|
57
|
+
/**
|
|
58
|
+
* Стиль метки всплывающей подсказки по умолчанию, которая является элементом p.
|
|
59
|
+
*/
|
|
60
|
+
labelStyle?: Record<string, unknown>;
|
|
61
|
+
/**
|
|
62
|
+
* Значение метки, которое сейчас активно, обычно рассчитывается внутри компании.
|
|
63
|
+
*/
|
|
64
|
+
label?: string | number;
|
|
65
|
+
/**
|
|
66
|
+
* Контент для тултипа
|
|
67
|
+
*/
|
|
68
|
+
content?: any;
|
|
69
|
+
}
|
|
70
|
+
export { TooltipProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { ReactElement, SVGProps } from 'react';
|
|
2
|
+
interface AxisProps {
|
|
3
|
+
/**
|
|
4
|
+
* Скрыть ось
|
|
5
|
+
*/
|
|
6
|
+
hide?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Отображение линии оси.
|
|
9
|
+
*/
|
|
10
|
+
axisLine: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Тип оси.
|
|
13
|
+
*/
|
|
14
|
+
type: 'number' | 'category';
|
|
15
|
+
/**
|
|
16
|
+
* Разрешить значениям оси быть десятичными или нет.
|
|
17
|
+
*/
|
|
18
|
+
allowDecimals?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Разрешить или нет на оси дублировать категории, если "type" оси - "category".
|
|
21
|
+
*/
|
|
22
|
+
allowDuplicatedCategory?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Угол наклона значений оси.
|
|
25
|
+
*/
|
|
26
|
+
angle?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Количество делений оси. Не используется, если "тип" - "категория".
|
|
29
|
+
*/
|
|
30
|
+
tickCount?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Интревал линий деления оси
|
|
33
|
+
*/
|
|
34
|
+
interval?: 'preserveStart' | 'preserveEnd' | 'preserveStartEnd' | number;
|
|
35
|
+
/**
|
|
36
|
+
* Минимальный зазор между двумя соседними делениями оси.
|
|
37
|
+
*/
|
|
38
|
+
minTickGap?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Отображение линий деления оси
|
|
41
|
+
*/
|
|
42
|
+
tickLine?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Размер линий деления оси
|
|
45
|
+
*/
|
|
46
|
+
tickSize?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Если установлено значение true, галочки переворачиваются вокруг оси, отображая метки внутри диаграммы, а не снаружи.
|
|
49
|
+
*/
|
|
50
|
+
mirror?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Отображение горизонтальной сетки
|
|
53
|
+
*/
|
|
54
|
+
reversed?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Реверсировать ось или нет
|
|
57
|
+
*/
|
|
58
|
+
tickMargin?: number;
|
|
59
|
+
/**
|
|
60
|
+
* Функция форматирования значения деления оси.
|
|
61
|
+
*/
|
|
62
|
+
tickFormatter?: (value: any, index: number) => string;
|
|
63
|
+
/**
|
|
64
|
+
* Присваивается автоматически в зависимости от переданных данных
|
|
65
|
+
*/
|
|
66
|
+
tick?: SVGProps<SVGTextElement> | ReactElement<SVGElement> | ((props: any) => ReactElement<SVGElement>) | boolean;
|
|
67
|
+
}
|
|
68
|
+
export { AxisProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface DataProps {
|
|
2
|
+
/**
|
|
3
|
+
* Метка
|
|
4
|
+
*/
|
|
5
|
+
label: string | number;
|
|
6
|
+
/**
|
|
7
|
+
* Значение
|
|
8
|
+
*/
|
|
9
|
+
value: number;
|
|
10
|
+
}
|
|
11
|
+
interface DataDynamicProps {
|
|
12
|
+
[key: string]: number | string;
|
|
13
|
+
}
|
|
14
|
+
interface DataDynamicBooleanProps {
|
|
15
|
+
[key: string]: boolean;
|
|
16
|
+
}
|
|
17
|
+
export { DataProps, DataDynamicProps, DataDynamicBooleanProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { CoordinatesProps } from "./coordinates.types";
|
|
2
|
+
import { DataProps } from "./data.types";
|
|
3
|
+
interface DotSettingProps {
|
|
4
|
+
/**
|
|
5
|
+
* Значение media query.
|
|
6
|
+
*/
|
|
7
|
+
media?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Значение маштаба при ховере.
|
|
10
|
+
*/
|
|
11
|
+
scale: number;
|
|
12
|
+
/**
|
|
13
|
+
* Начальный значения маштаба.
|
|
14
|
+
*/
|
|
15
|
+
initScale: number;
|
|
16
|
+
/**
|
|
17
|
+
* Ширина точки.
|
|
18
|
+
*/
|
|
19
|
+
width: number;
|
|
20
|
+
/**
|
|
21
|
+
* Высота точки.
|
|
22
|
+
*/
|
|
23
|
+
height: number;
|
|
24
|
+
}
|
|
25
|
+
interface ActiveDotProps {
|
|
26
|
+
/**
|
|
27
|
+
* Индекс предыдущей точки.
|
|
28
|
+
*/
|
|
29
|
+
prev: number | null;
|
|
30
|
+
/**
|
|
31
|
+
* Индекс активной точки.
|
|
32
|
+
*/
|
|
33
|
+
active: number | null;
|
|
34
|
+
}
|
|
35
|
+
interface PointProps extends CoordinatesProps {
|
|
36
|
+
value: string | number;
|
|
37
|
+
payload: DataProps;
|
|
38
|
+
}
|
|
39
|
+
interface DotProps {
|
|
40
|
+
/**
|
|
41
|
+
* Индекс активной точки на графике.
|
|
42
|
+
*/
|
|
43
|
+
activeDot: null | number;
|
|
44
|
+
/**
|
|
45
|
+
* Координата Х.
|
|
46
|
+
*/
|
|
47
|
+
cx: number;
|
|
48
|
+
/**
|
|
49
|
+
* Координата У.
|
|
50
|
+
*/
|
|
51
|
+
cy: number;
|
|
52
|
+
/**
|
|
53
|
+
* Ключ данных.
|
|
54
|
+
*/
|
|
55
|
+
dataKey: string;
|
|
56
|
+
/**
|
|
57
|
+
* Параметры точки.
|
|
58
|
+
*/
|
|
59
|
+
dotSettings?: DotSettingProps;
|
|
60
|
+
/**
|
|
61
|
+
* Индекс.
|
|
62
|
+
*/
|
|
63
|
+
index: number;
|
|
64
|
+
/**
|
|
65
|
+
* Цвет линии.
|
|
66
|
+
*/
|
|
67
|
+
stroke: string;
|
|
68
|
+
/**
|
|
69
|
+
* Значения по этим координатам.
|
|
70
|
+
*/
|
|
71
|
+
value: number;
|
|
72
|
+
}
|
|
73
|
+
export { DotSettingProps, ActiveDotProps, PointProps, DotProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
interface GradientProps {
|
|
2
|
+
/**
|
|
3
|
+
* Отступ.
|
|
4
|
+
*/
|
|
5
|
+
offset: number;
|
|
6
|
+
/**
|
|
7
|
+
* Цвет.
|
|
8
|
+
*/
|
|
9
|
+
stopColor: string;
|
|
10
|
+
/**
|
|
11
|
+
* Значение празрачности.
|
|
12
|
+
*/
|
|
13
|
+
stopOpacity: number;
|
|
14
|
+
}
|
|
15
|
+
interface LinearGradientProps {
|
|
16
|
+
/**
|
|
17
|
+
* Индефикатор графика.
|
|
18
|
+
*/
|
|
19
|
+
id: string;
|
|
20
|
+
/**
|
|
21
|
+
* Индефикатор градиента.
|
|
22
|
+
*/
|
|
23
|
+
gid: string;
|
|
24
|
+
/**
|
|
25
|
+
* Массив настроек градинта.
|
|
26
|
+
*/
|
|
27
|
+
points: GradientProps[];
|
|
28
|
+
}
|
|
29
|
+
export { GradientProps, LinearGradientProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { XAxisProps } from "../xAxis.types";
|
|
3
|
+
interface TickProps {
|
|
4
|
+
payload: {
|
|
5
|
+
coordinate: number;
|
|
6
|
+
value: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Функция форматирования
|
|
10
|
+
*/
|
|
11
|
+
tickFormatter: (value: number | string) => React.ReactText;
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
/**
|
|
15
|
+
* Настройки оси Х
|
|
16
|
+
*/
|
|
17
|
+
xAxis: XAxisProps;
|
|
18
|
+
}
|
|
19
|
+
export { TickProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AxisProps } from "./utils/axis.types";
|
|
2
|
+
interface XAxisProps extends AxisProps {
|
|
3
|
+
/**
|
|
4
|
+
* Ключ данных, отображаемых на оси.
|
|
5
|
+
*/
|
|
6
|
+
dataKey: string | number;
|
|
7
|
+
/**
|
|
8
|
+
* Ориентация оси
|
|
9
|
+
*/
|
|
10
|
+
orientation?: 'top' | 'bottom';
|
|
11
|
+
/**
|
|
12
|
+
* Тип деления оси
|
|
13
|
+
*/
|
|
14
|
+
tickType?: 'point';
|
|
15
|
+
}
|
|
16
|
+
export { XAxisProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-chart",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.1",
|
|
4
4
|
"description": "Chart component",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"directory": "dist"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@alfalab/core-components-typography": "^4.
|
|
14
|
+
"@alfalab/core-components-typography": "^4.10.1",
|
|
15
15
|
"classnames": "^2.3.1",
|
|
16
16
|
"recharts": "^2.1.2",
|
|
17
17
|
"tslib": "^2.4.0"
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": "^16.9.0 || ^17.0.1 || ^18.0.0"
|
|
24
24
|
},
|
|
25
|
-
"themesVersion": "13.0
|
|
26
|
-
"varsVersion": "9.
|
|
25
|
+
"themesVersion": "13.2.0",
|
|
26
|
+
"varsVersion": "9.13.0"
|
|
27
27
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import '@alfalab/core-components-
|
|
1
|
+
@import '@alfalab/core-components-vars/src/index.css';
|
|
2
2
|
|
|
3
3
|
.legendContent {
|
|
4
4
|
display: flex;
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
.legendWrap {
|
|
10
10
|
width: 100%;
|
|
11
|
-
margin: 0;
|
|
12
|
-
padding: 0;
|
|
11
|
+
margin: var(--gap-0);
|
|
12
|
+
padding: var(--gap-0);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.legendItem {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
.legendItem:last-child {
|
|
22
|
-
margin-right: 0;
|
|
22
|
+
margin-right: var(--gap-0);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.legendUnactive {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
@import '@alfalab/core-components-
|
|
1
|
+
@import '@alfalab/core-components-vars/src/index.css';
|
|
2
2
|
|
|
3
3
|
.tooltip {
|
|
4
4
|
background-color: var(--color-light-base-bg-primary);
|
|
5
5
|
border: 1px solid var(--color-light-neutral-400);
|
|
6
6
|
box-shadow: var(--shadow-l);
|
|
7
|
-
border-radius: var(--border-radius-
|
|
7
|
+
border-radius: var(--border-radius-8);
|
|
8
8
|
padding: var(--gap-12) var(--gap-16);
|
|
9
9
|
pointer-events: none;
|
|
10
10
|
position: relative;
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
position: relative;
|
|
15
15
|
z-index: 5;
|
|
16
16
|
list-style-type: none;
|
|
17
|
-
padding: 0;
|
|
18
|
-
margin: 0;
|
|
17
|
+
padding: var(--gap-0);
|
|
18
|
+
margin: var(--gap-0);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
.tooltipItem {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
.tooltipArrow {
|
|
26
26
|
position: absolute;
|
|
27
|
-
left: 0;
|
|
27
|
+
left: var(--gap-0);
|
|
28
28
|
top: 50%;
|
|
29
29
|
transform: translate(-50%, -50%) scale(1, 1) rotate(45deg);
|
|
30
30
|
width: 10px;
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
.tooltipArrow:before {
|
|
37
37
|
content: '';
|
|
38
38
|
position: absolute;
|
|
39
|
-
left: -
|
|
40
|
-
top: -
|
|
39
|
+
left: var(--gap-2-neg);
|
|
40
|
+
top: var(--gap-2-neg);
|
|
41
41
|
width: 0;
|
|
42
42
|
height: 0;
|
|
43
43
|
border-style: solid;
|
package/src/index.module.css
CHANGED