From 93a95eab5a26032493b7d659324e0991c1b43eb2 Mon Sep 17 00:00:00 2001 From: OkunElya Date: Thu, 16 Apr 2026 00:52:01 +1000 Subject: [PATCH] added table page --- site/package-lock.json | 338 +++++++++++++++++++++ site/package.json | 1 + site/src/chart/Chart.tsx | 51 ++++ site/src/chart/components/GroupChart.tsx | 62 ++++ site/src/chart/components/GroupGrid.tsx | 30 ++ site/src/chart/components/SettingChart.tsx | 95 ++++++ site/src/chart/groupdata.tsx | 87 ++++++ site/src/list/List.tsx | 12 + site/src/list/components/RamGrid.tsx | 28 ++ site/src/list/table.tsx | 75 +++++ site/src/main.tsx | 20 +- 11 files changed, 789 insertions(+), 10 deletions(-) create mode 100644 site/src/chart/Chart.tsx create mode 100644 site/src/chart/components/GroupChart.tsx create mode 100644 site/src/chart/components/GroupGrid.tsx create mode 100644 site/src/chart/components/SettingChart.tsx create mode 100644 site/src/chart/groupdata.tsx create mode 100644 site/src/list/List.tsx create mode 100644 site/src/list/components/RamGrid.tsx create mode 100644 site/src/list/table.tsx diff --git a/site/package-lock.json b/site/package-lock.json index 325a7e4..a875c1c 100644 --- a/site/package-lock.json +++ b/site/package-lock.json @@ -14,6 +14,7 @@ "@mui/material": "^9.0.0", "@mui/x-charts": "^9.0.1", "@mui/x-data-grid": "^9.0.1", + "d3": "^7.9.0", "react": "^19.2.4", "react-dom": "^19.2.4", "react-router-dom": "^7.14.1" @@ -2206,6 +2207,15 @@ "dev": true, "license": "MIT" }, + "node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "license": "MIT", + "engines": { + "node": ">= 10" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -2279,6 +2289,47 @@ "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", "license": "MIT" }, + "node_modules/d3": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/d3/-/d3-7.9.0.tgz", + "integrity": "sha512-e1U46jVP+w7Iut8Jt8ri1YsPOvFpg46k+K8TpCb0P+zjCkjkPnV7WzfDJzMHy1LnA+wj5pLT1wjO901gLXeEhA==", + "license": "ISC", + "dependencies": { + "d3-array": "3", + "d3-axis": "3", + "d3-brush": "3", + "d3-chord": "3", + "d3-color": "3", + "d3-contour": "4", + "d3-delaunay": "6", + "d3-dispatch": "3", + "d3-drag": "3", + "d3-dsv": "3", + "d3-ease": "3", + "d3-fetch": "3", + "d3-force": "3", + "d3-format": "3", + "d3-geo": "3", + "d3-hierarchy": "3", + "d3-interpolate": "3", + "d3-path": "3", + "d3-polygon": "3", + "d3-quadtree": "3", + "d3-random": "3", + "d3-scale": "4", + "d3-scale-chromatic": "3", + "d3-selection": "3", + "d3-shape": "3", + "d3-time": "3", + "d3-time-format": "4", + "d3-timer": "3", + "d3-transition": "3", + "d3-zoom": "3" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/d3-array": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", @@ -2291,6 +2342,43 @@ "node": ">=12" } }, + "node_modules/d3-axis": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-axis/-/d3-axis-3.0.0.tgz", + "integrity": "sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-brush": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-3.0.0.tgz", + "integrity": "sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ==", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-drag": "2 - 3", + "d3-interpolate": "1 - 3", + "d3-selection": "3", + "d3-transition": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-chord": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-chord/-/d3-chord-3.0.1.tgz", + "integrity": "sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g==", + "license": "ISC", + "dependencies": { + "d3-path": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/d3-color": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", @@ -2300,6 +2388,112 @@ "node": ">=12" } }, + "node_modules/d3-contour": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/d3-contour/-/d3-contour-4.0.2.tgz", + "integrity": "sha512-4EzFTRIikzs47RGmdxbeUvLWtGedDUNkTcmzoeyg4sP/dvCexO47AaQL7VKy/gul85TOxw+IBgA8US2xwbToNA==", + "license": "ISC", + "dependencies": { + "d3-array": "^3.2.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-delaunay": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/d3-delaunay/-/d3-delaunay-6.0.4.tgz", + "integrity": "sha512-mdjtIZ1XLAM8bm/hx3WwjfHt6Sggek7qH043O8KEjDXN40xi3vx/6pYSVTwLjEgiXQTbvaouWKynLBiUZ6SK6A==", + "license": "ISC", + "dependencies": { + "delaunator": "5" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dispatch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz", + "integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-drag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz", + "integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-selection": "3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-dsv": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-3.0.1.tgz", + "integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==", + "license": "ISC", + "dependencies": { + "commander": "7", + "iconv-lite": "0.6", + "rw": "1" + }, + "bin": { + "csv2json": "bin/dsv2json.js", + "csv2tsv": "bin/dsv2dsv.js", + "dsv2dsv": "bin/dsv2dsv.js", + "dsv2json": "bin/dsv2json.js", + "json2csv": "bin/json2dsv.js", + "json2dsv": "bin/json2dsv.js", + "json2tsv": "bin/json2dsv.js", + "tsv2csv": "bin/dsv2dsv.js", + "tsv2json": "bin/dsv2json.js" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-ease": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", + "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-fetch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-fetch/-/d3-fetch-3.0.1.tgz", + "integrity": "sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw==", + "license": "ISC", + "dependencies": { + "d3-dsv": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-force": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-force/-/d3-force-3.0.0.tgz", + "integrity": "sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-quadtree": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/d3-format": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.2.tgz", @@ -2309,6 +2503,27 @@ "node": ">=12" } }, + "node_modules/d3-geo": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-3.1.1.tgz", + "integrity": "sha512-637ln3gXKXOwhalDzinUgY83KzNWZRKbYubaG+fGVuc/dxO64RRljtCTnf5ecMyE1RIdtqpkVcq0IbtU2S8j2Q==", + "license": "ISC", + "dependencies": { + "d3-array": "2.5.0 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-hierarchy": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz", + "integrity": "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/d3-interpolate": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", @@ -2330,6 +2545,33 @@ "node": ">=12" } }, + "node_modules/d3-polygon": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-polygon/-/d3-polygon-3.0.1.tgz", + "integrity": "sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-quadtree": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-3.0.1.tgz", + "integrity": "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-random": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-random/-/d3-random-3.0.1.tgz", + "integrity": "sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/d3-scale": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", @@ -2346,6 +2588,28 @@ "node": ">=12" } }, + "node_modules/d3-scale-chromatic": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz", + "integrity": "sha512-A3s5PWiZ9YCXFye1o246KoscMWqf8BsD9eRiJ3He7C9OBaxKhAd5TFCdEx/7VbKtxxTsu//1mMJFrEt572cEyQ==", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3", + "d3-interpolate": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-selection": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz", + "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/d3-shape": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz", @@ -2391,6 +2655,41 @@ "node": ">=12" } }, + "node_modules/d3-transition": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-3.0.1.tgz", + "integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3", + "d3-dispatch": "1 - 3", + "d3-ease": "1 - 3", + "d3-interpolate": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "d3-selection": "2 - 3" + } + }, + "node_modules/d3-zoom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.0.tgz", + "integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==", + "license": "ISC", + "dependencies": { + "d3-dispatch": "1 - 3", + "d3-drag": "2 - 3", + "d3-interpolate": "1 - 3", + "d3-selection": "2 - 3", + "d3-transition": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/debug": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", @@ -2415,6 +2714,15 @@ "dev": true, "license": "MIT" }, + "node_modules/delaunator": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/delaunator/-/delaunator-5.1.0.tgz", + "integrity": "sha512-AGrQ4QSgssa1NGmWmLPqN5NY2KajF5MqxetNEO+o0n3ZwZZeTmt7bBnvzHWrmkZFxGgr4HdyFgelzgi06otLuQ==", + "license": "ISC", + "dependencies": { + "robust-predicates": "^3.0.2" + } + }, "node_modules/detect-libc": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", @@ -2882,6 +3190,18 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "license": "MIT" }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/ignore": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", @@ -3775,6 +4095,12 @@ "node": ">=4" } }, + "node_modules/robust-predicates": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.3.tgz", + "integrity": "sha512-NS3levdsRIUOmiJ8FZWCP7LG3QpJyrs/TE0Zpf1yvZu8cAJJ6QMW92H1c7kWpdIHo8RvmLxN/o2JXTKHp74lUA==", + "license": "Unlicense" + }, "node_modules/rolldown": { "version": "1.0.0-rc.15", "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.15.tgz", @@ -3816,6 +4142,18 @@ "dev": true, "license": "MIT" }, + "node_modules/rw": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", + "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==", + "license": "BSD-3-Clause" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, "node_modules/scheduler": { "version": "0.27.0", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", diff --git a/site/package.json b/site/package.json index 7ece650..56e78ad 100644 --- a/site/package.json +++ b/site/package.json @@ -16,6 +16,7 @@ "@mui/material": "^9.0.0", "@mui/x-charts": "^9.0.1", "@mui/x-data-grid": "^9.0.1", + "d3": "^7.9.0", "react": "^19.2.4", "react-dom": "^19.2.4", "react-router-dom": "^7.14.1" diff --git a/site/src/chart/Chart.tsx b/site/src/chart/Chart.tsx new file mode 100644 index 0000000..714b1c4 --- /dev/null +++ b/site/src/chart/Chart.tsx @@ -0,0 +1,51 @@ +import Navbar from "../components/Navbar"; +import CustomFooter from "../components/CustomFooter"; +import Select from '@mui/material/Select'; +import type { SelectChangeEvent } from '@mui/material/Select'; +import Box from '@mui/material/Box'; +import InputLabel from '@mui/material/InputLabel'; +import MenuItem from '@mui/material/MenuItem'; +import FormControl from '@mui/material/FormControl'; +import * as React from 'react'; +import {years, countries, types } from "./groupdata"; +import GroupGrid from "./components/GroupGrid"; +import GroupChart from "./components/GroupChart"; + +type tSelect = "Страна" | "Год" | "Тип"; + +function Chart() { + const [group, setGroup] = React.useState("Страна"); + const [groupData, setGroupData] = React.useState(countries); + + + const handleChange = (event: SelectChangeEvent) => { + setGroup(event.target.value as tSelect); + setGroupData([countries, years, types][["Страна", "Год", "Тип"].indexOf(event.target.value)]); + } + + return ( + <> + + + + Группировать по + + + + + + + + ); +} + +export default Chart; \ No newline at end of file diff --git a/site/src/chart/components/GroupChart.tsx b/site/src/chart/components/GroupChart.tsx new file mode 100644 index 0000000..023b916 --- /dev/null +++ b/site/src/chart/components/GroupChart.tsx @@ -0,0 +1,62 @@ +import { BarChart } from '@mui/x-charts/BarChart'; +import { LineChart } from '@mui/x-charts/LineChart'; +import Container from '@mui/material/Container'; +import type { tGroup } from "../groupdata"; +import { useState } from 'react'; +import SettingChart from "./SettingChart"; + +type GroupProps = { + data: tGroup; +}; + + +function GroupChart({ data }: GroupProps) { + const [isBar, setIsBar] = useState(true); + const [series, setSeries] = useState({ + 'Максимальная высота': true, + 'Средняя высота': false, + 'Минимальная высота': false, + }); + const selectedSeries = Object.entries(series).filter(item => item[1] === true); + let seriesY = selectedSeries.map(item => { + return { + dataKey: item[0], + label: item[0], + barLabel: selectedSeries.length === 1 ? ('value' as const) : undefined, + } + }); + const chartSetting = { + yAxis: [{ label: 'Высота (м)' }], + height: 400, + }; + + return ( + + {isBar && } + {!isBar &&} + + + ) +}; + +export default GroupChart; \ No newline at end of file diff --git a/site/src/chart/components/GroupGrid.tsx b/site/src/chart/components/GroupGrid.tsx new file mode 100644 index 0000000..a676594 --- /dev/null +++ b/site/src/chart/components/GroupGrid.tsx @@ -0,0 +1,30 @@ + +import { DataGrid } from "@mui/x-data-grid"; +import type { GridRowsProp, GridColDef } from "@mui/x-data-grid"; +import Container from '@mui/material/Container'; +import { ruRU } from '@mui/x-data-grid/locales'; +import type { tGroup } from "../groupdata"; +type GroupProps = { + data: tGroup; +}; + +function GroupGrid({ data }: GroupProps) { + const rows: GridRowsProp = data; + const columns: GridColDef[] = [ + { field: 'Группа', headerName: 'Группа', flex: 1}, + { field: 'Минимальная высота', flex: 0.5}, + { field: 'Максимальная высота', flex: 0.5}, + { field: 'Средняя высота', flex: 0.5}, + ] + return ( + + + + ) +} + +export default GroupGrid; \ No newline at end of file diff --git a/site/src/chart/components/SettingChart.tsx b/site/src/chart/components/SettingChart.tsx new file mode 100644 index 0000000..36f239d --- /dev/null +++ b/site/src/chart/components/SettingChart.tsx @@ -0,0 +1,95 @@ +import FormControl from '@mui/material/FormControl'; +import FormLabel from '@mui/material/FormLabel'; +import FormControlLabel from '@mui/material/FormControlLabel'; +import Checkbox from '@mui/material/Checkbox'; + +import Stack from '@mui/material/Stack'; +import Divider from '@mui/material/Divider'; +import RadioGroup from '@mui/material/RadioGroup'; +import Radio from '@mui/material/Radio'; +import Container from '@mui/material/Container'; +type tSeries = { + 'Максимальная высота': boolean, + 'Средняя высота': boolean, + 'Минимальная высота': boolean, +} +type CheckboxProps = { + series: tSeries; + setSeries: React.Dispatch>; + isBar: boolean; + setIsBar: React.Dispatch> +}; + +function SettingChart({ series, setSeries, isBar, setIsBar }: CheckboxProps) { + const handleChange = (event: React.ChangeEvent) => { + setSeries({ + ...series, + [event.target.name]: event.target.checked, + }); + }; + + const handleRadioButtonChange = (event: React.ChangeEvent) => { + setIsBar(event.target.value === "bar"); + }; + return ( + } + spacing={2} + sx={{ m: "20px 0", justifyContent: "center", }} + > + + + Тип диаграммы: + + + + } + label="Гистограмма" + /> + + } + label="Линейная" + /> + + + + + На диаграмме показать: + + + } + label="максимальную высоту" + /> + + } + label="среднюю высоту" + /> + + } + label="минимальную высоту" + /> + + + ) +} +export default SettingChart; \ No newline at end of file diff --git a/site/src/chart/groupdata.tsx b/site/src/chart/groupdata.tsx new file mode 100644 index 0000000..388c976 --- /dev/null +++ b/site/src/chart/groupdata.tsx @@ -0,0 +1,87 @@ +export type tGroup = { + "id": number, + "Группа": string | number, + "Минимальная высота": number , + "Максимальная высота": number , + "Средняя высота": number, + }[]; + +export const countries: tGroup = [ + { "id": 1, "Группа": "Вьетнам" , "Минимальная высота": 461 , "Максимальная высота": 461 , "Средняя высота": 461 }, + { "id": 2, "Группа": "Германия" , "Минимальная высота": 368 , "Максимальная высота": 368 , "Средняя высота": 368 }, + { "id": 3, "Группа": "Гонконг" , "Минимальная высота": 367 , "Максимальная высота": 484 , "Средняя высота": 410 }, + { "id": 4, "Группа": "Испания" , "Минимальная высота": 356 , "Максимальная высота": 356 , "Средняя высота": 356 }, + { "id": 5, "Группа": "Иран" , "Минимальная высота": 435 , "Максимальная высота": 435 , "Средняя высота": 435 }, + { "id": 6, "Группа": "Казахстан" , "Минимальная высота": 372 , "Максимальная высота": 420 , "Средняя высота": 391 }, + { "id": 7, "Группа": "Канада" , "Минимальная высота": 355 , "Максимальная высота": 553 , "Средняя высота": 429 }, + { "id": 8, "Группа": "КНР" , "Минимальная высота": 356 , "Максимальная высота": 632 , "Средняя высота": 464 }, + { "id": 9, "Группа": "Кувейт" , "Минимальная высота": 372 , "Максимальная высота": 412 , "Средняя высота": 392 }, + { "id": 10, "Группа": "Латвия" , "Минимальная высота": 369 , "Максимальная высота": 369 , "Средняя высота": 369 }, + { "id": 11, "Группа": "Малайзия" , "Минимальная высота": 421 , "Максимальная высота": 452 , "Средняя высота": 437 }, + { "id": 12, "Группа": "ОАЭ" , "Минимальная высота": 355 , "Максимальная высота": 828 , "Средняя высота": 461 }, + { "id": 13, "Группа": "Польша" , "Минимальная высота": 646 , "Максимальная высота": 646 , "Средняя высота": 646 }, + { "id": 14, "Группа": "Россия" , "Минимальная высота": 354 , "Максимальная высота": 540 , "Средняя высота": 420 }, + { "id": 15, "Группа": "Румыния" , "Минимальная высота": 352 , "Максимальная высота": 352 , "Средняя высота": 352 }, + { "id": 16, "Группа": "Словения" , "Минимальная высота": 360 , "Максимальная высота": 360 , "Средняя высота": 360 }, + { "id": 17, "Группа": "США" , "Минимальная высота": 350 , "Максимальная высота": 629 , "Средняя высота": 437 }, + { "id": 18, "Группа": "Тайвань" , "Минимальная высота": 378 , "Максимальная высота": 509 , "Средняя высота": 444 }, + { "id": 19, "Группа": "Узбекистан" , "Минимальная высота": 350 , "Максимальная высота": 375 , "Средняя высота": 363 }, + { "id": 20, "Группа": "Украина" , "Минимальная высота": 354 , "Максимальная высота": 385 , "Средняя высота": 370 }, + { "id": 21, "Группа": "Южная Корея" , "Минимальная высота": 555 , "Максимальная высота": 555 , "Средняя высота": 555 }, + { "id": 22, "Группа": "Япония" , "Минимальная высота": 634 , "Максимальная высота": 634 , "Средняя высота": 634 }, + ]; + + + export const years: tGroup = [ + { "id": 1 , "Группа": 1931 , "Максимальная высота": 449 , "Минимальная высота": 449 , "Средняя высота": 449 }, + { "id": 2 , "Группа": 1961 , "Максимальная высота": 354 , "Минимальная высота": 354 , "Средняя высота": 354 }, + { "id": 3 , "Группа": 1963 , "Максимальная высота": 629 , "Минимальная высота": 629 , "Средняя высота": 629 }, + { "id": 4 , "Группа": 1967 , "Максимальная высота": 540 , "Минимальная высота": 540 , "Средняя высота": 540 }, + { "id": 5 , "Группа": 1968 , "Максимальная высота": 368 , "Минимальная высота": 368 , "Средняя высота": 368 }, + { "id": 6 , "Группа": 1969 , "Максимальная высота": 457 , "Минимальная высота": 368 , "Средняя высота": 413 }, + { "id": 7 , "Группа": 1971 , "Максимальная высота": 380 , "Минимальная высота": 380 , "Средняя высота": 380 }, + { "id": 8 , "Группа": 1973 , "Максимальная высота": 385 , "Минимальная высота": 385 , "Средняя высота": 385 }, + { "id": 9 , "Группа": 1974 , "Максимальная высота": 646 , "Минимальная высота": 356 , "Средняя высота": 510 }, + { "id": 10 , "Группа": 1976 , "Максимальная высота": 553 , "Минимальная высота": 355 , "Средняя высота": 423 }, + { "id": 11 , "Группа": 1977 , "Максимальная высота": 371 , "Минимальная высота": 371 , "Средняя высота": 371 }, + { "id": 12 , "Группа": 1980 , "Максимальная высота": 350 , "Минимальная высота": 350 , "Средняя высота": 350 }, + { "id": 13 , "Группа": 1983 , "Максимальная высота": 372 , "Минимальная высота": 372 , "Средняя высота": 372 }, + { "id": 14 , "Группа": 1985 , "Максимальная высота": 375 , "Минимальная высота": 370 , "Средняя высота": 373 }, + { "id": 15 , "Группа": 1987 , "Максимальная высота": 420 , "Минимальная высота": 369 , "Средняя высота": 395 }, + { "id": 16 , "Группа": 1990 , "Максимальная высота": 367 , "Минимальная высота": 367 , "Средняя высота": 367 }, + { "id": 17 , "Группа": 1991 , "Максимальная высота": 415 , "Минимальная высота": 415 , "Средняя высота": 415 }, + { "id": 18 , "Группа": 1992 , "Максимальная высота": 405 , "Минимальная высота": 374 , "Средняя высота": 390 }, + { "id": 19 , "Группа": 1994 , "Максимальная высота": 468 , "Минимальная высота": 468 , "Средняя высота": 468 }, + { "id": 20 , "Группа": 1995 , "Максимальная высота": 421 , "Минимальная высота": 352 , "Средняя высота": 387 }, + { "id": 21 , "Группа": 1996 , "Максимальная высота": 384 , "Минимальная высота": 350 , "Средняя высота": 369 }, + { "id": 22 , "Группа": 1997 , "Максимальная высота": 391 , "Минимальная высота": 378 , "Средняя высота": 385 }, + { "id": 23 , "Группа": 1998 , "Максимальная высота": 452 , "Минимальная высота": 452 , "Средняя высота": 452 }, + { "id": 24 , "Группа": 1999 , "Максимальная высота": 421 , "Минимальная высота": 421 , "Средняя высота": 421 }, + { "id": 25 , "Группа": 2000 , "Максимальная высота": 356 , "Минимальная высота": 355 , "Средняя высота": 356 }, + { "id": 26 , "Группа": 2003 , "Максимальная высота": 435 , "Минимальная высота": 416 , "Средняя высота": 426 }, + { "id": 27 , "Группа": 2004 , "Максимальная высота": 509 , "Минимальная высота": 509 , "Средняя высота": 509 }, + { "id": 28 , "Группа": 2008 , "Максимальная высота": 492 , "Минимальная высота": 363 , "Средняя высота": 407 }, + { "id": 29 , "Группа": 2009 , "Максимальная высота": 600 , "Минимальная высота": 423 , "Средняя высота": 489 }, + { "id": 30 , "Группа": 2010 , "Максимальная высота": 828 , "Минимальная высота": 376 , "Средняя высота": 514 }, + { "id": 31 , "Группа": 2011 , "Максимальная высота": 440 , "Минимальная высота": 440 , "Средняя высота": 440 }, + { "id": 32 , "Группа": 2012 , "Максимальная высота": 634 , "Минимальная высота": 634 , "Средняя высота": 634 }, + { "id": 33 , "Группа": 2013 , "Максимальная высота": 632 , "Минимальная высота": 632 , "Средняя высота": 632 }, + { "id": 34 , "Группа": 2014 , "Максимальная высота": 381 , "Минимальная высота": 381 , "Средняя высота": 381 }, + { "id": 35 , "Группа": 2015 , "Максимальная высота": 426 , "Минимальная высота": 354 , "Средняя высота": 387 }, + { "id": 36 , "Группа": 2016 , "Максимальная высота": 374 , "Минимальная высота": 374 , "Средняя высота": 374 }, + { "id": 37 , "Группа": 2017 , "Максимальная высота": 600 , "Минимальная высота": 555 , "Средняя высота": 578 }, + { "id": 38 , "Группа": 2018 , "Максимальная высота": 462 , "Минимальная высота": 461 , "Средняя высота": 462 }, + + + ]; + + export const types: tGroup = [ + { "id": 1 , "Группа": "Антенная мачта" , "Максимальная высота": 646 , "Минимальная высота": 646 , "Средняя высота": 646 }, + { "id": 2 , "Группа": "Башня" , "Максимальная высота": 375 , "Минимальная высота": 372 , "Средняя высота": 374 }, + { "id": 3 , "Группа": "Бетонная башня" , "Максимальная высота": 634 , "Минимальная высота": 350 , "Средняя высота": 444 }, + { "id": 4 , "Группа": "Гиперболоидная башня" , "Максимальная высота": 600 , "Минимальная высота": 600 , "Средняя высота": 600 }, + { "id": 5 , "Группа": "Дымовая труба" , "Максимальная высота": 420 , "Минимальная высота": 350 , "Средняя высота": 370 }, + { "id": 6 , "Группа": "Небоскрёб" , "Максимальная высота": 828 , "Минимальная высота": 354 , "Средняя высота": 441 }, + { "id": 7 , "Группа": "Радиомачта" , "Максимальная высота": 629 , "Минимальная высота": 354 , "Средняя высота": 492 }, + { "id": 8 , "Группа": "Решётчатая мачта" , "Максимальная высота": 385 , "Минимальная высота": 385 , "Средняя высота": 385 }, + ]; \ No newline at end of file diff --git a/site/src/list/List.tsx b/site/src/list/List.tsx new file mode 100644 index 0000000..4579a19 --- /dev/null +++ b/site/src/list/List.tsx @@ -0,0 +1,12 @@ +import Navbar from "../components/Navbar"; +import RamGrid from "./components/RamGrid"; + +function List() { + return ( +
+ + +
+ ); +} +export default List; \ No newline at end of file diff --git a/site/src/list/components/RamGrid.tsx b/site/src/list/components/RamGrid.tsx new file mode 100644 index 0000000..13de946 --- /dev/null +++ b/site/src/list/components/RamGrid.tsx @@ -0,0 +1,28 @@ +import { DataGrid } from "@mui/x-data-grid"; +import type { GridRowsProp, GridColDef } from "@mui/x-data-grid"; +import Container from '@mui/material/Container'; +import { ruRU } from '@mui/x-data-grid/locales'; + +import ram_prices from "../table"; + +function RamGrid() { + const rows: GridRowsProp = ram_prices; + const columns: GridColDef[] = [ + { field: 'type', headerName: 'Type', flex: 0.5}, + { field: 'name', headerName: 'Model', flex: 1}, + { field: 'maker', headerName: 'Maker', flex: 0.5}, + { field: 'size', headerName: 'Size (GB)',lex: 0.5}, + { field: 'release', headerName: 'Release Year-month'}, + { field: 'price' ,headerName: 'Price(USD)'}, + ] + return ( + + + + ) +} +export default RamGrid; \ No newline at end of file diff --git a/site/src/list/table.tsx b/site/src/list/table.tsx new file mode 100644 index 0000000..0c144aa --- /dev/null +++ b/site/src/list/table.tsx @@ -0,0 +1,75 @@ + +const ram_prices = [ + { "type": "DDR3", "name": "DDR3-1600-4GB-A1", "size": 4, "maker": "Kingston", "release": "2014-03", "price": 18, }, + { "type": "DDR3", "name": "DDR3-1600-8GB-A2", "size": 8, "maker": "Corsair", "release": "2015-06", "price": 26, }, + { "type": "DDR3", "name": "DDR3-1866-8GB-A3", "size": 8, "maker": "G.Skill", "release": "2016-02", "price": 29, }, + { "type": "DDR4", "name": "DDR4-2133-8GB-B1", "size": 8, "maker": "Crucial", "release": "2017-01", "price": 24, }, + { "type": "DDR4", "name": "DDR4-2400-8GB-B2", "size": 8, "maker": "Kingston", "release": "2017-09", "price": 27, }, + { "type": "DDR4", "name": "DDR4-2666-16GB-B3", "size": 16, "maker": "Corsair", "release": "2018-04", "price": 48, }, + { "type": "DDR4", "name": "DDR4-3000-16GB-B4", "size": 16, "maker": "G.Skill", "release": "2018-11", "price": 52, }, + { "type": "DDR4", "name": "DDR4-3200-16GB-B5", "size": 16, "maker": "HyperX", "release": "2019-03", "price": 55, }, + { "type": "DDR4", "name": "DDR4-3200-32GB-B6", "size": 32, "maker": "Crucial", "release": "2019-08", "price": 92, }, + { "type": "DDR4", "name": "DDR4-3600-32GB-B7", "size": 32, "maker": "Corsair", "release": "2020-02", "price": 99, }, + { "type": "DDR5", "name": "DDR5-4800-16GB-C1", "size": 16, "maker": "Kingston", "release": "2021-01", "price": 78, }, + { "type": "DDR5", "name": "DDR5-5200-16GB-C2", "size": 16, "maker": "Corsair", "release": "2021-06", "price": 84, }, + { "type": "DDR5", "name": "DDR5-5600-32GB-C3", "size": 32, "maker": "G.Skill", "release": "2022-02", "price": 145, }, + { "type": "DDR5", "name": "DDR5-6000-32GB-C4", "size": 32, "maker": "Crucial", "release": "2022-07", "price": 158, }, + { "type": "DDR5", "name": "DDR5-6400-32GB-C5", "size": 32, "maker": "Corsair", "release": "2023-01", "price": 172, }, + { "type": "DDR5", "name": "DDR5-6600-64GB-C6", "size": 64, "maker": "Kingston", "release": "2023-05", "price": 310, }, + { "type": "DDR5", "name": "DDR5-6800-64GB-C7", "size": 64, "maker": "G.Skill", "release": "2023-09", "price": 329, }, + { "type": "DDR5", "name": "DDR5-7200-64GB-C8", "size": 64, "maker": "Corsair", "release": "2024-02", "price": 355, }, + { "type": "DDR5", "name": "DDR5-7600-96GB-C9", "size": 96, "maker": "Crucial", "release": "2024-06", "price": 520, }, + { "type": "DDR5", "name": "DDR5-8000-96GB-C10", "size": 96, "maker": "Kingston", "release": "2024-10", "price": 560, }, + { "type": "LPDDR4", "name": "LP4-3200-8GB-D1", "size": 8, "maker": "Samsung", "release": "2019-01", "price": 34, }, + { "type": "LPDDR4", "name": "LP4-4266-8GB-D2", "size": 8, "maker": "Micron", "release": "2019-07", "price": 39, }, + { "type": "LPDDR5", "name": "LP5-5500-12GB-D3", "size": 12, "maker": "Samsung", "release": "2020-03", "price": 58, }, + { "type": "LPDDR5", "name": "LP5-6400-16GB-D4", "size": 16, "maker": "SKHynix", "release": "2021-01", "price": 74, }, + { "type": "LPDDR5X", "name": "LP5X-7500-24GB-D5", "size": 24, "maker": "Micron", "release": "2022-05", "price": 118, }, + { "type": "DDR4", "name": "DDR4-2666-8GB-E1", "size": 8, "maker": "Patriot", "release": "2018-05", "price": 25, }, + { "type": "DDR4", "name": "DDR4-3000-8GB-E2", "size": 8, "maker": "ADATA", "release": "2018-09", "price": 28, }, + { "type": "DDR4", "name": "DDR4-3200-8GB-E3", "size": 8, "maker": "TeamGroup", "release": "2019-04", "price": 30, }, + { "type": "DDR4", "name": "DDR4-3600-16GB-E4", "size": 16, "maker": "ADATA", "release": "2020-01", "price": 53, }, + { "type": "DDR4", "name": "DDR4-4000-16GB-E5", "size": 16, "maker": "Patriot", "release": "2020-06", "price": 61, }, + { "type": "DDR5", "name": "DDR5-5200-8GB-F1", "size": 8, "maker": "TeamGroup", "release": "2021-03", "price": 52, }, + { "type": "DDR5", "name": "DDR5-5600-16GB-F2", "size": 16, "maker": "ADATA", "release": "2021-10", "price": 88, }, + { "type": "DDR5", "name": "DDR5-6000-16GB-F3", "size": 16, "maker": "Patriot", "release": "2022-03", "price": 95, }, + { "type": "DDR5", "name": "DDR5-6400-32GB-F4", "size": 32, "maker": "TeamGroup", "release": "2022-09", "price": 168, }, + { "type": "DDR5", "name": "DDR5-7200-32GB-F5", "size": 32, "maker": "ADATA", "release": "2023-04", "price": 185, }, + { "type": "DDR3", "name": "DDR3-1333-4GB-G1", "size": 4, "maker": "Samsung", "release": "2013-02", "price": 15, }, + { "type": "DDR3", "name": "DDR3-1600-4GB-G2", "size": 4, "maker": "Micron", "release": "2014-08", "price": 17, }, + { "type": "DDR3", "name": "DDR3-1866-8GB-G3", "size": 8, "maker": "Samsung", "release": "2015-11", "price": 28, }, + { "type": "DDR5", "name": "DDR5-8400-128GB-H1", "size": 128, "maker": "Corsair", "release": "2025-01", "price": 890, }, + { "type": "DDR5", "name": "DDR5-8800-128GB-H2", "size": 128, "maker": "G.Skill", "release": "2025-03", "price": 940, }, + { "type": "DDR5", "name": "DDR5-9200-128GB-H3", "size": 128, "maker": "Kingston", "release": "2025-06", "price": 990, }, + { "type": "DDR5", "name": "DDR5-6000-48GB-X1", "size": 48, "maker": "Corsair", "release": "2024-01", "price": 210, }, + { "type": "DDR5", "name": "DDR5-6000-48GB-X2", "size": 48, "maker": "Kingston", "release": "2024-02", "price": 215, }, + { "type": "DDR5", "name": "DDR5-6000-48GB-X3", "size": 48, "maker": "G.Skill", "release": "2024-03", "price": 218, }, + { "type": "DDR5", "name": "DDR5-6000-48GB-X4", "size": 48, "maker": "ADATA", "release": "2024-04", "price": 222, }, + { "type": "DDR5", "name": "DDR5-6000-48GB-X5", "size": 48, "maker": "Patriot", "release": "2024-05", "price": 225, }, + { "type": "DDR5", "name": "DDR5-6000-48GB-X6", "size": 48, "maker": "TeamGroup", "release": "2024-06", "price": 228, }, + { "type": "DDR5", "name": "DDR5-6000-48GB-X7", "size": 48, "maker": "Crucial", "release": "2024-07", "price": 230, }, + { "type": "DDR5", "name": "DDR5-6000-48GB-X8", "size": 48, "maker": "Samsung", "release": "2024-08", "price": 235, }, + { "type": "DDR5", "name": "DDR5-6000-48GB-X9", "size": 48, "maker": "Micron", "release": "2024-09", "price": 238, }, + { "type": "DDR5", "name": "DDR5-6000-48GB-X10", "size": 48, "maker": "SKHynix", "release": "2024-10", "price": 240, }, + { "type": "DDR4", "name": "DDR4-3200-64GB-Y1", "size": 64, "maker": "Corsair", "release": "2021-01", "price": 180, }, + { "type": "DDR4", "name": "DDR4-3200-64GB-Y2", "size": 64, "maker": "Kingston", "release": "2021-02", "price": 182, }, + { "type": "DDR4", "name": "DDR4-3200-64GB-Y3", "size": 64, "maker": "G.Skill", "release": "2021-03", "price": 185, }, + { "type": "DDR4", "name": "DDR4-3200-64GB-Y4", "size": 64, "maker": "ADATA", "release": "2021-04", "price": 188, }, + { "type": "DDR4", "name": "DDR4-3200-64GB-Y5", "size": 64, "maker": "Patriot", "release": "2021-05", "price": 190, }, + { "type": "DDR4", "name": "DDR4-3200-64GB-Y6", "size": 64, "maker": "TeamGroup", "release": "2021-06", "price": 192, }, + { "type": "DDR4", "name": "DDR4-3200-64GB-Y7", "size": 64, "maker": "Crucial", "release": "2021-07", "price": 195, }, + { "type": "DDR4", "name": "DDR4-3200-64GB-Y8", "size": 64, "maker": "Samsung", "release": "2021-08", "price": 198, }, + { "type": "DDR4", "name": "DDR4-3200-64GB-Y9", "size": 64, "maker": "Micron", "release": "2021-09", "price": 200, }, + { "type": "DDR4", "name": "DDR4-3200-64GB-Y10", "size": 64, "maker": "SKHynix", "release": "2021-10", "price": 205, } + +] +const ram_sticks = ram_prices.map((x,index) => ({ + ...x, + id: index + 1, + // release: Number(x.release.split("-")[0]), +})) + + + + +export default ram_sticks; diff --git a/site/src/main.tsx b/site/src/main.tsx index 4a53167..879e191 100644 --- a/site/src/main.tsx +++ b/site/src/main.tsx @@ -6,8 +6,8 @@ import { RouterProvider, } from "react-router-dom"; -// import List from "./list/List"; -// import Chart from "./chart/Chart"; +import List from "./list/List"; +import Chart from "./chart/Chart"; import Main from "./main/Main"; import ProjectDetails from "./projectDetails/ProjectDetails"; @@ -22,14 +22,14 @@ const router = createBrowserRouter([ path: "/project-details/:id", element: , }, - // { - // path: "/chart", - // element: , - // }, - // { - // path: "/building/:id", - // element: , - // }, + { + path: "/list", + element: , + }, + { + path: "/chart", + element: , + }, ]);