Skip to content

Commit d64c638

Browse files
committed
first start
1 parent b2ce812 commit d64c638

File tree

8 files changed

+151
-24
lines changed

8 files changed

+151
-24
lines changed

.prettierrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"singleQuote": true,
3-
"tabWidth": 4
3+
"tabWidth": 4,
4+
"printWidth": 200
45
}

.vscode/arduino.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"board": "esp8266:esp8266:huzzah",
33
"configuration": "xtal=80,vt=flash,exception=disabled,eesz=4M,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200",
4-
"port": "COM3"
4+
"port": "COM12"
55
}

.vscode/c_cpp_properties.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
{
44
"name": "Win32",
55
"includePath": [
6-
"C:\\Users\\Igor\\AppData\\Local\\Arduino15\\packages\\esp8266\\tools\\**",
7-
"C:\\Users\\Igor\\AppData\\Local\\Arduino15\\packages\\esp8266\\hardware\\esp8266\\2.5.0\\**"
6+
"C:\\\\Users\\\\Igor\\\\AppData\\\\Local\\\\Arduino15\\\\packages\\\\esp8266\\\\tools\\\\**",
7+
"C:\\\\Users\\\\Igor\\\\AppData\\\\Local\\\\Arduino15\\\\packages\\\\esp8266\\\\hardware\\\\esp8266\\\\2.5.0\\\\**"
88
],
9-
"forcedInclude": []
9+
"forcedInclude": [],
10+
"compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.13.26128/bin/Hostx64/x64/cl.exe",
11+
"cppStandard": "c++17"
1012
}
11-
]
13+
],
14+
"version": 4
1215
}

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,12 @@
6363
"@babel/polyfill": "^7.4.4",
6464
"@material-ui/core": "^4.0.0",
6565
"@material-ui/icons": "^4.0.0",
66+
"cors": "^2.8.5",
6667
"express": "^4.17.0",
6768
"react": "^16.8.6",
6869
"react-dom": "^16.8.6",
6970
"react-helmet": "^5.2.1",
70-
"cors": "^2.8.5",
71-
"react-router-dom": "^5.0.0"
71+
"react-router-dom": "^5.0.0",
72+
"react-virtualized": "^9.21.1"
7273
}
7374
}

src/client/components/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import HideOnScroll from './HideOnScroll';
2+
import MuiVirtualizedTable from './MuiVirtualizedTable';
23

3-
4-
export {
5-
HideOnScroll
6-
}
4+
export { HideOnScroll, MuiVirtualizedTable };

src/client/views/home/index.js

Lines changed: 93 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,107 @@
11
import React from 'react';
22
import { withStyles } from '@material-ui/core/styles';
3+
import Paper from '@material-ui/core/Paper';
4+
import { MuiVirtualizedTable as VirtualizedTable } from '../../components';
35

4-
const styles = theme => ({
5-
6-
});
6+
import Parser from '../../parser';
7+
import testData from '../../parser/test_data/DJIFlightRecord_2018-10-03_[13-23-50].txt';
8+
9+
const styles = theme => ({});
710

811
class Home extends React.Component {
12+
constructor() {
13+
super();
14+
const sample = [
15+
['Frozen yoghurt', 159, 6.0, 24, 4.0],
16+
['Ice cream sandwich', 237, 9.0, 37, 4.3],
17+
['Eclair', 262, 16.0, 24, 6.0],
18+
['Cupcake', 305, 3.7, 67, 4.3],
19+
['Gingerbread', 356, 16.0, 49, 3.9]
20+
];
21+
22+
for (let i = 0; i < 200; i += 1) {
23+
const randomSelection =
24+
sample[Math.floor(Math.random() * sample.length)];
25+
this.rows.push(this.createData(i, ...randomSelection));
26+
}
27+
28+
this.parser = new Parser();
29+
this.parser.on('CUSTOM'.toLowerCase(), (data) => {
30+
this.state.data = data;
31+
console.debug({data});
32+
})
33+
this.parser.on('warn', (msg, warnInfo) => {
34+
console.warn(msg, warnInfo);
35+
})
36+
this.parser.on('error', (msg, errInfo)=> {
37+
console.error(msg, errInfo);
38+
})
39+
40+
41+
this.state = {};
42+
}
43+
rows = [];
44+
45+
createData = (id, dessert, calories, fat, carbs, protein) => {
46+
return { id, dessert, calories, fat, carbs, protein };
47+
};
48+
49+
componentDidMount = () => {
50+
console.debug('Component Index Mount');
51+
this.parser.parse(testData);
52+
53+
}
54+
955
render() {
1056
return (
1157
<React.Fragment>
12-
<div>
13-
{[...Array(1000)].map(() => (
14-
'Content'
15-
)).join(' ')}
16-
</div>
58+
<div>{[...Array(1000)].map(() => 'Content').join(' ')}</div>
59+
{this.ReactVirtualizedTable()}
1760
</React.Fragment>
1861
);
1962
}
63+
64+
ReactVirtualizedTable = () => {
65+
return (
66+
<Paper style={{ height: 400, width: '100%' }}>
67+
<VirtualizedTable
68+
rowCount={this.rows.length}
69+
rowGetter={({ index }) => this.rows[index]}
70+
columns={[
71+
{
72+
width: 200,
73+
label: 'Dessert',
74+
dataKey: 'dessert'
75+
},
76+
{
77+
width: 120,
78+
label: 'Calories\u00A0(g)',
79+
dataKey: 'calories',
80+
numeric: true
81+
},
82+
{
83+
width: 120,
84+
label: 'Fat\u00A0(g)',
85+
dataKey: 'fat',
86+
numeric: true
87+
},
88+
{
89+
width: 120,
90+
label: 'Carbs\u00A0(g)',
91+
dataKey: 'carbs',
92+
numeric: true
93+
},
94+
{
95+
width: 120,
96+
label: 'Protein\u00A0(g)',
97+
dataKey: 'protein',
98+
numeric: true
99+
}
100+
]}
101+
/>
102+
</Paper>
103+
);
104+
};
20105
}
21106

22107
export default withStyles(styles, { withTheme: true })(Home);

webpack.config.common.babel.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ const baseConfig = {
6767
name: '[name].[ext]',
6868
outputPath: __dirname + 'fonts/'
6969
}
70+
},
71+
{
72+
test: /\.(txt|dat)$/,
73+
use: [
74+
{
75+
loader: 'file-loader',
76+
}
77+
]
7078
}
7179
]
7280
},

yarn.lock

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,6 +1611,14 @@ babel-loader@^8.0.6:
16111611
mkdirp "^0.5.1"
16121612
pify "^4.0.1"
16131613

1614+
babel-runtime@^6.26.0:
1615+
version "6.26.0"
1616+
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe"
1617+
integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4=
1618+
dependencies:
1619+
core-js "^2.4.0"
1620+
regenerator-runtime "^0.11.0"
1621+
16141622
bail@^1.0.0:
16151623
version "1.0.4"
16161624
resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.4.tgz#7181b66d508aa3055d3f6c13f0a0c720641dde9b"
@@ -2013,7 +2021,7 @@ clone-deep@^0.2.4:
20132021
lazy-cache "^1.0.3"
20142022
shallow-clone "^0.1.2"
20152023

2016-
clsx@^1.0.2:
2024+
clsx@^1.0.1, clsx@^1.0.2:
20172025
version "1.0.4"
20182026
resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.0.4.tgz#0c0171f6d5cb2fe83848463c15fcc26b4df8c2ec"
20192027
integrity sha512-1mQ557MIZTrL/140j+JVdRM6e31/OA4vTYxXgqIIZlndyfjHpyawKZia1Im05Vp9BWmImkcNrNtFYQMyFcgJDg==
@@ -2197,7 +2205,7 @@ core-js@^1.0.0:
21972205
resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636"
21982206
integrity sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=
21992207

2200-
core-js@^2.6.5:
2208+
core-js@^2.4.0, core-js@^2.6.5:
22012209
version "2.6.8"
22022210
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.8.tgz#dc3a1e633a04267944e0cb850d3880f340248139"
22032211
integrity sha512-RWlREFU74TEkdXzyl1bka66O3kYp8jeTXrvJZDzVVMH8AiHUSOFpL1yfhQJ+wHocAm1m+4971W1PPzfLuCv1vg==
@@ -2567,7 +2575,7 @@ dom-converter@^0.2:
25672575
dependencies:
25682576
utila "~0.4"
25692577

2570-
dom-helpers@^3.4.0:
2578+
"dom-helpers@^2.4.0 || ^3.0.0", dom-helpers@^3.4.0:
25712579
version "3.4.0"
25722580
resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-3.4.0.tgz#e9b369700f959f62ecde5a6babde4bccd9169af8"
25732581
integrity sha512-LnuPJ+dwqKDIyotW1VzmOZ5TONUN7CwkCR5hrgawTUbkBGYdeoNLZo6nNfGkCrjtE1nXXaj7iMMpDa8/d9WoIA==
@@ -4153,6 +4161,11 @@ levn@^0.3.0, levn@~0.3.0:
41534161
prelude-ls "~1.1.2"
41544162
type-check "~0.3.2"
41554163

4164+
linear-layout-vector@0.0.1:
4165+
version "0.0.1"
4166+
resolved "https://registry.yarnpkg.com/linear-layout-vector/-/linear-layout-vector-0.0.1.tgz#398114d7303b6ecc7fd6b273af7b8401d8ba9c70"
4167+
integrity sha1-OYEU1zA7bsx/1rJzr3uEAdi6nHA=
4168+
41564169
load-json-file@^2.0.0:
41574170
version "2.0.0"
41584171
resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8"
@@ -4228,7 +4241,7 @@ lodash@^4.17.11, lodash@^4.17.3, lodash@^4.17.5:
42284241
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
42294242
integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==
42304243

4231-
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.1, loose-envify@^1.4.0:
4244+
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0, loose-envify@^1.3.0, loose-envify@^1.3.1, loose-envify@^1.4.0:
42324245
version "1.4.0"
42334246
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
42344247
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
@@ -5793,6 +5806,19 @@ react-transition-group@^4.0.0:
57935806
loose-envify "^1.4.0"
57945807
prop-types "^15.6.2"
57955808

5809+
react-virtualized@^9.21.1:
5810+
version "9.21.1"
5811+
resolved "https://registry.yarnpkg.com/react-virtualized/-/react-virtualized-9.21.1.tgz#4dbbf8f0a1420e2de3abf28fbb77120815277b3a"
5812+
integrity sha512-E53vFjRRMCyUTEKuDLuGH1ld/9TFzjf/fFW816PE4HFXWZorESbSTYtiZz1oAjra0MminaUU1EnvUxoGuEFFPA==
5813+
dependencies:
5814+
babel-runtime "^6.26.0"
5815+
clsx "^1.0.1"
5816+
dom-helpers "^2.4.0 || ^3.0.0"
5817+
linear-layout-vector "0.0.1"
5818+
loose-envify "^1.3.0"
5819+
prop-types "^15.6.0"
5820+
react-lifecycles-compat "^3.0.4"
5821+
57965822
react@^16.8.6:
57975823
version "16.8.6"
57985824
resolved "https://registry.yarnpkg.com/react/-/react-16.8.6.tgz#ad6c3a9614fd3a4e9ef51117f54d888da01f2bbe"
@@ -5863,6 +5889,11 @@ regenerate@^1.4.0:
58635889
resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11"
58645890
integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==
58655891

5892+
regenerator-runtime@^0.11.0:
5893+
version "0.11.1"
5894+
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9"
5895+
integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==
5896+
58665897
regenerator-runtime@^0.13.2:
58675898
version "0.13.2"
58685899
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz#32e59c9a6fb9b1a4aff09b4930ca2d4477343447"

0 commit comments

Comments
 (0)