@alfalab/core-components-chart 3.1.12 → 3.2.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 (108) hide show
  1. package/Component.d.ts +2 -1
  2. package/Component.js +1 -1
  3. package/components/Dot/index.css +8 -8
  4. package/components/Dot/index.js +1 -1
  5. package/components/Legends/index.css +8 -8
  6. package/components/Legends/index.js +1 -1
  7. package/components/Tick/index.css +4 -4
  8. package/components/Tick/index.d.ts +2 -1
  9. package/components/Tick/index.js +1 -1
  10. package/components/TooltipContent/index.css +7 -7
  11. package/components/TooltipContent/index.d.ts +2 -1
  12. package/components/TooltipContent/index.js +1 -1
  13. package/cssm/Component.d.ts +2 -1
  14. package/cssm/components/Tick/index.d.ts +2 -1
  15. package/cssm/components/TooltipContent/index.d.ts +2 -1
  16. package/cssm/icons/Circle.d.ts +2 -1
  17. package/cssm/icons/FilledCircle.d.ts +2 -1
  18. package/cssm/icons/Point.d.ts +2 -1
  19. package/cssm/icons/StrokeCircle.d.ts +2 -1
  20. package/esm/Component.d.ts +2 -1
  21. package/esm/Component.js +1 -1
  22. package/esm/components/Dot/index.css +8 -8
  23. package/esm/components/Dot/index.js +1 -1
  24. package/esm/components/Legends/index.css +8 -8
  25. package/esm/components/Legends/index.js +1 -1
  26. package/esm/components/Tick/index.css +4 -4
  27. package/esm/components/Tick/index.d.ts +2 -1
  28. package/esm/components/Tick/index.js +1 -1
  29. package/esm/components/TooltipContent/index.css +7 -7
  30. package/esm/components/TooltipContent/index.d.ts +2 -1
  31. package/esm/components/TooltipContent/index.js +1 -1
  32. package/esm/icons/Circle.d.ts +2 -1
  33. package/esm/icons/FilledCircle.d.ts +2 -1
  34. package/esm/icons/Point.d.ts +2 -1
  35. package/esm/icons/StrokeCircle.d.ts +2 -1
  36. package/esm/index.css +5 -5
  37. package/icons/Circle.d.ts +2 -1
  38. package/icons/FilledCircle.d.ts +2 -1
  39. package/icons/Point.d.ts +2 -1
  40. package/icons/StrokeCircle.d.ts +2 -1
  41. package/index.css +5 -5
  42. package/modern/Component.d.ts +2 -1
  43. package/modern/Component.js +1 -1
  44. package/modern/components/Dot/index.css +8 -8
  45. package/modern/components/Dot/index.js +1 -1
  46. package/modern/components/Legends/index.css +8 -8
  47. package/modern/components/Legends/index.js +1 -1
  48. package/modern/components/Tick/index.css +4 -4
  49. package/modern/components/Tick/index.d.ts +2 -1
  50. package/modern/components/Tick/index.js +1 -1
  51. package/modern/components/TooltipContent/index.css +7 -7
  52. package/modern/components/TooltipContent/index.d.ts +2 -1
  53. package/modern/components/TooltipContent/index.js +1 -1
  54. package/modern/icons/Circle.d.ts +2 -1
  55. package/modern/icons/FilledCircle.d.ts +2 -1
  56. package/modern/icons/Point.d.ts +2 -1
  57. package/modern/icons/StrokeCircle.d.ts +2 -1
  58. package/modern/index.css +5 -5
  59. package/package.json +2 -2
  60. package/src/Component.tsx +404 -0
  61. package/src/components/CustomizedLabel.tsx +29 -0
  62. package/src/components/Dot/index.module.css +22 -0
  63. package/src/components/Dot/index.tsx +79 -0
  64. package/src/components/Legends/index.module.css +36 -0
  65. package/src/components/Legends/index.tsx +85 -0
  66. package/src/components/LinearGradient.tsx +16 -0
  67. package/src/components/RectBar.tsx +50 -0
  68. package/src/components/Tick/index.module.css +16 -0
  69. package/src/components/Tick/index.tsx +32 -0
  70. package/src/components/TooltipContent/index.module.css +51 -0
  71. package/src/components/TooltipContent/index.tsx +83 -0
  72. package/src/hoc/Customized.jsx +7 -0
  73. package/src/hooks/usePathBar/index.tsx +56 -0
  74. package/src/hooks/usePathBar/utils/getRadius.ts +5 -0
  75. package/src/hooks/useSettings/index.tsx +66 -0
  76. package/src/hooks/useSettings/utils/setComposedChartsMargin.ts +29 -0
  77. package/src/hooks/useSettings/utils/setDatas.ts +53 -0
  78. package/src/hooks/useSettings/utils/setGradientCharts.ts +43 -0
  79. package/src/hooks/useSettings/utils/setLegendMargin.ts +16 -0
  80. package/src/hooks/useSettings/utils/sortByIndex.ts +10 -0
  81. package/src/icons/Circle.tsx +12 -0
  82. package/src/icons/CircleLine.tsx +13 -0
  83. package/src/icons/FilledCircle.tsx +25 -0
  84. package/src/icons/Point.tsx +13 -0
  85. package/src/icons/StrokeCircle.tsx +12 -0
  86. package/src/index.module.css +21 -0
  87. package/src/index.ts +2 -0
  88. package/src/types/brush.types.ts +50 -0
  89. package/src/types/cartesianGrid.types.ts +26 -0
  90. package/src/types/chart.types.ts +81 -0
  91. package/src/types/composedChart.types.ts +36 -0
  92. package/src/types/index.ts +14 -0
  93. package/src/types/labelList.types.ts +5 -0
  94. package/src/types/legend.types.ts +35 -0
  95. package/src/types/options.types.ts +69 -0
  96. package/src/types/payload.types.ts +33 -0
  97. package/src/types/responsiveContainer.types.ts +9 -0
  98. package/src/types/seria.types.ts +86 -0
  99. package/src/types/tooltip.types.ts +85 -0
  100. package/src/types/utils/axis.types.ts +88 -0
  101. package/src/types/utils/coordinates.types.ts +11 -0
  102. package/src/types/utils/data.types.ts +19 -0
  103. package/src/types/utils/dot.types.ts +88 -0
  104. package/src/types/utils/gradient.types.ts +33 -0
  105. package/src/types/utils/index.ts +6 -0
  106. package/src/types/utils/tick.types.ts +38 -0
  107. package/src/types/xAxis.types.ts +18 -0
  108. package/src/types/yAxis.types.ts +8 -0
@@ -0,0 +1,88 @@
1
+ import { CoordinatesProps } from './coordinates.types';
2
+ import { DataProps } from './data.types';
3
+
4
+ export interface DotSettingProps {
5
+ /**
6
+ * Значение media query.
7
+ */
8
+ media?: number;
9
+
10
+ /**
11
+ * Значение маштаба при ховере.
12
+ */
13
+ scale: number;
14
+
15
+ /**
16
+ * Начальный значения маштаба.
17
+ */
18
+ initScale: number;
19
+
20
+ /**
21
+ * Ширина точки.
22
+ */
23
+ width: number;
24
+
25
+ /**
26
+ * Высота точки.
27
+ */
28
+ height: number;
29
+ }
30
+
31
+ export interface ActiveDotProps {
32
+ /**
33
+ * Индекс предыдущей точки.
34
+ */
35
+ prev: number | null;
36
+
37
+ /**
38
+ * Индекс активной точки.
39
+ */
40
+ active: number | null;
41
+ }
42
+
43
+ export interface PointProps extends CoordinatesProps {
44
+ value: string | number;
45
+ payload: DataProps;
46
+ }
47
+
48
+ export interface DotProps {
49
+ /**
50
+ * Индекс активной точки на графике.
51
+ */
52
+ activeDot: null | number;
53
+
54
+ /**
55
+ * Координата Х.
56
+ */
57
+ cx: number;
58
+
59
+ /**
60
+ * Координата У.
61
+ */
62
+ cy: number;
63
+
64
+ /**
65
+ * Ключ данных.
66
+ */
67
+ dataKey: string;
68
+
69
+ /**
70
+ * Параметры точки.
71
+ */
72
+ dotSettings?: DotSettingProps;
73
+
74
+ /**
75
+ * Индекс.
76
+ */
77
+ index: number;
78
+
79
+ /**
80
+ * Цвет линии.
81
+ */
82
+ stroke: string;
83
+
84
+ /**
85
+ * Значения по этим координатам.
86
+ */
87
+ value: number;
88
+ }
@@ -0,0 +1,33 @@
1
+ export interface GradientProps {
2
+ /**
3
+ * Отступ.
4
+ */
5
+ offset: number;
6
+
7
+ /**
8
+ * Цвет.
9
+ */
10
+ stopColor: string;
11
+
12
+ /**
13
+ * Значение празрачности.
14
+ */
15
+ stopOpacity: number;
16
+ }
17
+
18
+ export interface LinearGradientProps {
19
+ /**
20
+ * Индефикатор графика.
21
+ */
22
+ id: string;
23
+
24
+ /**
25
+ * Индефикатор градиента.
26
+ */
27
+ gid: string;
28
+
29
+ /**
30
+ * Массив настроек градинта.
31
+ */
32
+ points: GradientProps[];
33
+ }
@@ -0,0 +1,6 @@
1
+ export * from './axis.types';
2
+ export * from './coordinates.types';
3
+ export * from './data.types';
4
+ export * from './dot.types';
5
+ export * from './gradient.types';
6
+ export * from './tick.types';
@@ -0,0 +1,38 @@
1
+ import { XAxisProps } from '../xAxis.types';
2
+
3
+ export interface TickProps {
4
+ /*
5
+ * Полезная нагрузка
6
+ */
7
+ payload: {
8
+ /*
9
+ * Координата по оси Х
10
+ */
11
+ coordinate: number;
12
+
13
+ /*
14
+ * Значение графика
15
+ */
16
+ value: number;
17
+ };
18
+
19
+ /**
20
+ * Функция форматирования
21
+ */
22
+ tickFormatter: (value: number | string) => React.ReactText;
23
+
24
+ /*
25
+ * Координата Х
26
+ */
27
+ x: number;
28
+
29
+ /*
30
+ * Координата У
31
+ */
32
+ y: number;
33
+
34
+ /**
35
+ * Настройки оси Х
36
+ */
37
+ xAxis: XAxisProps;
38
+ }
@@ -0,0 +1,18 @@
1
+ import { AxisProps } from './utils/axis.types';
2
+
3
+ export interface XAxisProps extends AxisProps {
4
+ /**
5
+ * Ключ данных, отображаемых на оси.
6
+ */
7
+ dataKey: string | number;
8
+
9
+ /**
10
+ * Ориентация оси
11
+ */
12
+ orientation?: 'top' | 'bottom';
13
+
14
+ /**
15
+ * Тип деления оси
16
+ */
17
+ tickType?: 'point';
18
+ }
@@ -0,0 +1,8 @@
1
+ import { AxisProps } from './utils/axis.types';
2
+
3
+ export interface YAxisProps extends AxisProps {
4
+ /**
5
+ * Ориентация оси
6
+ */
7
+ orientation?: 'left' | 'right';
8
+ }