@alfalab/core-components-chart 3.1.11 → 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.
- package/Component.d.ts +2 -1
- package/Component.js +1 -1
- package/components/Dot/index.css +8 -8
- package/components/Dot/index.js +1 -1
- package/components/Legends/index.css +8 -8
- package/components/Legends/index.js +1 -1
- package/components/Tick/index.css +4 -4
- package/components/Tick/index.d.ts +2 -1
- package/components/Tick/index.js +1 -1
- package/components/TooltipContent/index.css +7 -7
- package/components/TooltipContent/index.d.ts +2 -1
- package/components/TooltipContent/index.js +1 -1
- package/cssm/Component.d.ts +2 -1
- package/cssm/components/Tick/index.d.ts +2 -1
- package/cssm/components/TooltipContent/index.d.ts +2 -1
- package/cssm/icons/Circle.d.ts +2 -1
- package/cssm/icons/FilledCircle.d.ts +2 -1
- package/cssm/icons/Point.d.ts +2 -1
- package/cssm/icons/StrokeCircle.d.ts +2 -1
- package/esm/Component.d.ts +2 -1
- 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 +8 -8
- package/esm/components/Legends/index.js +1 -1
- package/esm/components/Tick/index.css +4 -4
- package/esm/components/Tick/index.d.ts +2 -1
- package/esm/components/Tick/index.js +1 -1
- package/esm/components/TooltipContent/index.css +7 -7
- package/esm/components/TooltipContent/index.d.ts +2 -1
- package/esm/components/TooltipContent/index.js +1 -1
- package/esm/icons/Circle.d.ts +2 -1
- package/esm/icons/FilledCircle.d.ts +2 -1
- package/esm/icons/Point.d.ts +2 -1
- package/esm/icons/StrokeCircle.d.ts +2 -1
- package/esm/index.css +5 -5
- package/icons/Circle.d.ts +2 -1
- package/icons/FilledCircle.d.ts +2 -1
- package/icons/Point.d.ts +2 -1
- package/icons/StrokeCircle.d.ts +2 -1
- package/index.css +5 -5
- package/modern/Component.d.ts +2 -1
- 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 +8 -8
- package/modern/components/Legends/index.js +1 -1
- package/modern/components/Tick/index.css +4 -4
- package/modern/components/Tick/index.d.ts +2 -1
- package/modern/components/Tick/index.js +1 -1
- package/modern/components/TooltipContent/index.css +7 -7
- package/modern/components/TooltipContent/index.d.ts +2 -1
- package/modern/components/TooltipContent/index.js +1 -1
- package/modern/icons/Circle.d.ts +2 -1
- package/modern/icons/FilledCircle.d.ts +2 -1
- package/modern/icons/Point.d.ts +2 -1
- package/modern/icons/StrokeCircle.d.ts +2 -1
- package/modern/index.css +5 -5
- package/package.json +2 -5
- package/src/Component.tsx +404 -0
- package/src/components/CustomizedLabel.tsx +29 -0
- package/src/components/Dot/index.module.css +22 -0
- package/src/components/Dot/index.tsx +79 -0
- package/src/components/Legends/index.module.css +36 -0
- package/src/components/Legends/index.tsx +85 -0
- package/src/components/LinearGradient.tsx +16 -0
- package/src/components/RectBar.tsx +50 -0
- package/src/components/Tick/index.module.css +16 -0
- package/src/components/Tick/index.tsx +32 -0
- package/src/components/TooltipContent/index.module.css +51 -0
- package/src/components/TooltipContent/index.tsx +83 -0
- package/src/hoc/Customized.jsx +7 -0
- package/src/hooks/usePathBar/index.tsx +56 -0
- package/src/hooks/usePathBar/utils/getRadius.ts +5 -0
- package/src/hooks/useSettings/index.tsx +66 -0
- package/src/hooks/useSettings/utils/setComposedChartsMargin.ts +29 -0
- package/src/hooks/useSettings/utils/setDatas.ts +53 -0
- package/src/hooks/useSettings/utils/setGradientCharts.ts +43 -0
- package/src/hooks/useSettings/utils/setLegendMargin.ts +16 -0
- package/src/hooks/useSettings/utils/sortByIndex.ts +10 -0
- package/src/icons/Circle.tsx +12 -0
- package/src/icons/CircleLine.tsx +13 -0
- package/src/icons/FilledCircle.tsx +25 -0
- package/src/icons/Point.tsx +13 -0
- package/src/icons/StrokeCircle.tsx +12 -0
- package/src/index.module.css +21 -0
- package/src/index.ts +2 -0
- package/src/types/brush.types.ts +50 -0
- package/src/types/cartesianGrid.types.ts +26 -0
- package/src/types/chart.types.ts +81 -0
- package/src/types/composedChart.types.ts +36 -0
- package/src/types/index.ts +14 -0
- package/src/types/labelList.types.ts +5 -0
- package/src/types/legend.types.ts +35 -0
- package/src/types/options.types.ts +69 -0
- package/src/types/payload.types.ts +33 -0
- package/src/types/responsiveContainer.types.ts +9 -0
- package/src/types/seria.types.ts +86 -0
- package/src/types/tooltip.types.ts +85 -0
- package/src/types/utils/axis.types.ts +88 -0
- package/src/types/utils/coordinates.types.ts +11 -0
- package/src/types/utils/data.types.ts +19 -0
- package/src/types/utils/dot.types.ts +88 -0
- package/src/types/utils/gradient.types.ts +33 -0
- package/src/types/utils/index.ts +6 -0
- package/src/types/utils/tick.types.ts +38 -0
- package/src/types/xAxis.types.ts +18 -0
- package/src/types/yAxis.types.ts +8 -0
- package/send-stats.js +0 -82
|
@@ -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,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
|
+
}
|
package/send-stats.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
const http = require('http');
|
|
2
|
-
const fs = require('fs');
|
|
3
|
-
const { promisify } = require('util');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
|
|
6
|
-
const readFile = promisify(fs.readFile);
|
|
7
|
-
|
|
8
|
-
async function main() {
|
|
9
|
-
const remoteHost = process.env.NIS_HOST || 'digital';
|
|
10
|
-
const remotePort = process.env.NIS_PORT || 80;
|
|
11
|
-
const remotePath = process.env.NIS_PATH || '/npm-install-stats/api/install-stats';
|
|
12
|
-
|
|
13
|
-
try {
|
|
14
|
-
const [_, node, os, arch] =
|
|
15
|
-
/node\/v(\d+\.\d+\.\d+) (\w+) (\w+)/.exec(process.env.npm_config_user_agent) || [];
|
|
16
|
-
const [__, npm] = /npm\/(\d+\.\d+\.\d+)/.exec(process.env.npm_config_user_agent) || [];
|
|
17
|
-
const [___, yarn] = /yarn\/(\d+\.\d+\.\d+)/.exec(process.env.npm_config_user_agent) || [];
|
|
18
|
-
|
|
19
|
-
let ownPackageJson, packageJson;
|
|
20
|
-
|
|
21
|
-
try {
|
|
22
|
-
const result = await Promise.all([
|
|
23
|
-
readFile(path.join(process.cwd(), 'package.json'), 'utf-8'),
|
|
24
|
-
readFile(path.join(process.cwd(), '../../../package.json'), 'utf-8'),
|
|
25
|
-
]);
|
|
26
|
-
|
|
27
|
-
ownPackageJson = JSON.parse(result[0]);
|
|
28
|
-
packageJson = JSON.parse(result[1]);
|
|
29
|
-
} catch (err) {
|
|
30
|
-
ownPackageJson = '';
|
|
31
|
-
packageJson = '';
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const data = {
|
|
35
|
-
node,
|
|
36
|
-
npm,
|
|
37
|
-
yarn,
|
|
38
|
-
os,
|
|
39
|
-
arch,
|
|
40
|
-
ownPackageJson: JSON.stringify(ownPackageJson),
|
|
41
|
-
packageJson: JSON.stringify(packageJson),
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const body = JSON.stringify(data);
|
|
45
|
-
|
|
46
|
-
const options = {
|
|
47
|
-
host: remoteHost,
|
|
48
|
-
port: remotePort,
|
|
49
|
-
path: remotePath,
|
|
50
|
-
method: 'POST',
|
|
51
|
-
headers: {
|
|
52
|
-
'Content-Type': 'application/json',
|
|
53
|
-
'Content-Length': body.length,
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
return new Promise((resolve, reject) => {
|
|
58
|
-
const req = http.request(options, (res) => {
|
|
59
|
-
res.on('end', () => {
|
|
60
|
-
resolve();
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
req.on('error', () => {
|
|
65
|
-
reject();
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
req.write(body);
|
|
69
|
-
req.end();
|
|
70
|
-
});
|
|
71
|
-
} catch (error) {
|
|
72
|
-
throw error;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
main()
|
|
77
|
-
.then(() => {
|
|
78
|
-
process.exit(0);
|
|
79
|
-
})
|
|
80
|
-
.catch(() => {
|
|
81
|
-
process.exit(0);
|
|
82
|
-
});
|