Skip to content

Commit

Permalink
modified file structure and updated tables (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
ckunchur committed Jul 16, 2023
1 parent 860808e commit 47824d0
Show file tree
Hide file tree
Showing 21 changed files with 579 additions and 594 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ module.exports = {
'no-console': 'off',
'react/prop-types': 'off',
'no-nested-ternary': 'off',
'import/no-named-as-default': 'off'
'import/no-named-as-default': 'off',
'import/no-extraneous-dependencies': 'off',
' import/no-useless-path-segments': 'off'
},
};
31 changes: 31 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"@emotion/styled": "^11.10.6",
"@firebase/firestore": "^3.8.4",
"@mui/material": "^5.13.6",
"@mui/x-data-grid": "^6.10.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
Expand Down
4 changes: 2 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import './App.css';
import Container from 'react-bootstrap/Container';
import Patients from './components/Patients';
import PatientList from './components/PatientList';
import ECGList from './components/ECGList';
import Login from './components/Login';
import Header from './components/Header';
Expand All @@ -18,7 +18,7 @@ function App() {
<Router>
<Routes>
<Route exact path="/" element={<PrivateRoute />}>
<Route exact path="/" element={<Patients />} />
<Route exact path="/" element={<PatientList />} />
</Route>
<Route exact path="/ecglist/:patient" element={<PrivateRoute />}>
<Route exact path="/ecglist/:patient" element={<ECGList />} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Container, Card } from 'react-bootstrap';
import { ExclamationTriangle } from 'react-bootstrap-icons';

function AdminWarning() {
export default function AdminWarning() {
return (
<Container>
<Card className="mt-3" style={{ width: '25em', margin: '0 auto' }}>
Expand All @@ -14,4 +14,3 @@ function AdminWarning() {
</Container>
)
}
export default AdminWarning;
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useState, useEffect } from 'react';
import ChartView from './ecg-chart';
import getVoltageData from './ecg-format';
// import { Stack } from '@mui/material';
import ECGChartView from '../ECGChartView';
import getVoltageData from '../ecg-format';
import Container from 'react-bootstrap/Container';

export default function Dashboard({ ecgdata }) {
Expand All @@ -12,15 +11,14 @@ export default function Dashboard({ ecgdata }) {
setData(getVoltageData(ecgdata));
}
}, [ecgdata]);
// return <ChartView data={data} />

return (

data &&
<Container>
<ChartView data={data[0]} />
<ChartView data={data[1]} />
<ChartView data={data[2]} />
<ECGChartView data={data[0]} />
<ECGChartView data={data[1]} />
<ECGChartView data={data[2]} />
</Container>

);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { CartesianGrid, Line, LineChart, ResponsiveContainer, XAxis, YAxis } from 'recharts';
// import Container from 'react-bootstrap/Container';

function ChartView({ data }) {
export default function ECGChartView({ data }) {

const gridLines = (start, stop, step) =>
Array.from(
Expand All @@ -10,27 +9,6 @@ function ChartView({ data }) {
);



// function getMinMax() {
// const times = []
// const voltages = []
// data.forEach(pairs => {
// times.push(pairs.x)
// voltages.push(pairs.y)
// })


// const time_min = Math.min(...times);

// const time_max = Math.max(...times);
// const voltage_min = Math.min(...voltages);
// const voltage_max = Math.max(...voltages);
// // console.log([time_min, time_max, voltage_min, voltage_max])
// return [time_min, time_max, voltage_min, voltage_max]

// }


return (
<ResponsiveContainer minWidth="600" height={250}>
<LineChart
Expand Down Expand Up @@ -91,4 +69,4 @@ function ChartView({ data }) {
);
}

export default ChartView;

188 changes: 0 additions & 188 deletions src/components/ECGList.js

This file was deleted.

Loading

0 comments on commit 47824d0

Please sign in to comment.