Skip to content

Commit 519e4e7

Browse files
committed
Apply virtualized component
1 parent 2d90b93 commit 519e4e7

10 files changed

Lines changed: 524 additions & 50 deletions

File tree

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,21 @@
4242
"i18next": "^19.0.2",
4343
"i18next-browser-languagedetector": "^4.0.1",
4444
"lodash": "^4.17.15",
45+
"rc-resize-observer": "^0.1.3",
4546
"react": "^16.12.0",
4647
"react-ace": "^8.0.0",
4748
"react-color": "^2.17.3",
49+
"react-custom-scrollbars": "^4.2.1",
4850
"react-data-grid": "^6.1.0",
4951
"react-dom": "^16.12.0",
5052
"react-helmet": "^5.2.1",
5153
"react-hot-loader": "^4.12.18",
54+
"react-resize-detector": "^4.2.1",
5255
"react-router": "^5.1.2",
5356
"react-router-dom": "^5.1.2",
5457
"react-split": "^2.0.7",
5558
"react-split-pane": "^0.1.89",
59+
"react-window": "^1.8.5",
5660
"resize-observer-polyfill": "^1.5.1",
5761
"store": "^2.0.12",
5862
"typescript": "^3.7.4",
@@ -74,11 +78,14 @@
7478
"@types/lodash": "^4.14.149",
7579
"@types/react": "^16.9.17",
7680
"@types/react-color": "^3.0.1",
81+
"@types/react-custom-scrollbars": "^4.0.6",
7782
"@types/react-data-grid": "^4.0.5",
7883
"@types/react-dom": "^16.9.4",
7984
"@types/react-helmet": "^5.0.14",
85+
"@types/react-resize-detector": "^4.2.0",
8086
"@types/react-router": "^5.1.4",
8187
"@types/react-router-dom": "^5.1.3",
88+
"@types/react-window": "^1.8.1",
8289
"@types/uuid": "^3.4.6",
8390
"@types/warning": "^3.0.0",
8491
"@types/webpack-env": "^1.14.1",

src/App.tsx

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,44 @@ import { Layout } from 'antd';
77
import Editor from './components/editor/Editor';
88
import { Psychrometrics } from './components/chart';
99
import { Menus } from './components/layout';
10+
import { Table } from './examples';
1011

1112
class App extends Component {
12-
render() {
13-
return (
14-
<div className="container">
15-
<Helmet>
16-
<meta charSet="utf-8" />
17-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
18-
<meta name="description" content="Data visualization analysis editor developed with react, antd, echarts" />
19-
<link rel="manifest" href={`${PUBLIC_URL}manifest.json`} />
20-
<link rel="shortcut icon" href={`${PUBLIC_URL}favicon.png`} />
21-
<link rel="stylesheet" href="https://fonts.googleapis.com/earlyaccess/notosanskr.css" />
22-
</Helmet>
23-
<Router>
24-
<Layout className="editor-container">
25-
<Menus />
26-
<Layout>
27-
<Switch>
28-
<Route exact={true} path="/">
29-
<Editor />
30-
</Route>
31-
<Route path="/psychrometrics">
32-
<Psychrometrics />
33-
</Route>
34-
</Switch>
35-
</Layout>
36-
</Layout>
37-
</Router>
38-
</div>
39-
);
40-
}
13+
render() {
14+
return (
15+
<div className="container">
16+
<Helmet>
17+
<meta charSet="utf-8" />
18+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
19+
<meta
20+
name="description"
21+
content="Data visualization analysis editor developed with react, antd, echarts"
22+
/>
23+
<link rel="manifest" href={`${PUBLIC_URL}manifest.json`} />
24+
<link rel="shortcut icon" href={`${PUBLIC_URL}favicon.png`} />
25+
<link rel="stylesheet" href="https://fonts.googleapis.com/earlyaccess/notosanskr.css" />
26+
</Helmet>
27+
<Router>
28+
<Layout className="editor-container">
29+
<Menus />
30+
<Layout>
31+
<Switch>
32+
<Route exact={true} path="/">
33+
<Editor />
34+
</Route>
35+
<Route path="/psychrometrics">
36+
<Psychrometrics />
37+
</Route>
38+
<Route path="/table">
39+
<Table />
40+
</Route>
41+
</Switch>
42+
</Layout>
43+
</Layout>
44+
</Router>
45+
</div>
46+
);
47+
}
4148
}
4249

4350
export default App;

src/components/form/test.json

Lines changed: 285 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,285 @@
1+
{
2+
"headers": {
3+
"Date": ["Tue, 17 Mar 2020 04:30:26 GMT"],
4+
"Content-Type": ["application/json"],
5+
"Content-Length": ["4005"],
6+
"Connection": ["keep-alive"],
7+
"x-amzn-RequestId": ["3326103a-a2f3-4bb3-96d2-93c29104e718"],
8+
"x-amz-apigw-id": ["JhHPbEXfoE0FTZw="],
9+
"X-Amzn-Trace-Id": ["Root=1-5e705262-8653502326579b564d8570e7;Sampled=0"]
10+
},
11+
"body": {
12+
"response": {
13+
"command": "SELECT",
14+
"rowCount": 14,
15+
"oid": null,
16+
"rows": [
17+
{
18+
"dga_acq_date": "2019-01-01T00:00:00.000Z",
19+
"h2": "5.300000",
20+
"ch4": "16.900000",
21+
"c2h4": "9.600000",
22+
"c2h6": "7.500000",
23+
"c2h2": "0.000000",
24+
"co": "171.800003"
25+
},
26+
{
27+
"dga_acq_date": "2018-01-01T00:00:00.000Z",
28+
"h2": "5.900000",
29+
"ch4": "8.500000",
30+
"c2h4": "15.800000",
31+
"c2h6": "1.000000",
32+
"c2h2": "0.000000",
33+
"co": "248.600006"
34+
},
35+
{
36+
"dga_acq_date": "2017-01-01T00:00:00.000Z",
37+
"h2": "5.540000",
38+
"ch4": "4.400000",
39+
"c2h4": "7.140000",
40+
"c2h6": "2.190000",
41+
"c2h2": "0.000000",
42+
"co": "132.240005"
43+
},
44+
{
45+
"dga_acq_date": "2015-01-15T00:00:00.000Z",
46+
"h2": "8.000000",
47+
"ch4": "2.200000",
48+
"c2h4": "0.700000",
49+
"c2h6": "1.300000",
50+
"c2h2": "0.000000",
51+
"co": "36.200001"
52+
},
53+
{
54+
"dga_acq_date": "2015-01-01T00:00:00.000Z",
55+
"h2": "8.000000",
56+
"ch4": "8.600000",
57+
"c2h4": "10.100000",
58+
"c2h6": "4.100000",
59+
"c2h2": "0.000000",
60+
"co": "226.899994"
61+
},
62+
{
63+
"dga_acq_date": "2013-01-01T00:00:00.000Z",
64+
"h2": "8.000000",
65+
"ch4": "5.000000",
66+
"c2h4": "7.000000",
67+
"c2h6": "1.000000",
68+
"c2h2": "0.000000",
69+
"co": "156.000000"
70+
},
71+
{
72+
"dga_acq_date": "2012-10-01T00:00:00.000Z",
73+
"h2": "11.000000",
74+
"ch4": "3.000000",
75+
"c2h4": "1.800000",
76+
"c2h6": "0.500000",
77+
"c2h2": "0.000000",
78+
"co": "79.300003"
79+
},
80+
{
81+
"dga_acq_date": "2012-09-01T00:00:00.000Z",
82+
"h2": "11.000000",
83+
"ch4": "3.700000",
84+
"c2h4": "3.300000",
85+
"c2h6": "0.500000",
86+
"c2h2": "0.000000",
87+
"co": "105.000000"
88+
},
89+
{
90+
"dga_acq_date": "2012-05-01T00:00:00.000Z",
91+
"h2": "9.100000",
92+
"ch4": "4.900000",
93+
"c2h4": "1.400000",
94+
"c2h6": "1.200000",
95+
"c2h2": "0.000000",
96+
"co": "12.600000"
97+
},
98+
{
99+
"dga_acq_date": "2012-04-01T00:00:00.000Z",
100+
"h2": "9.100000",
101+
"ch4": "4.900000",
102+
"c2h4": "1.400000",
103+
"c2h6": "1.200000",
104+
"c2h2": "0.000000",
105+
"co": "236.800003"
106+
},
107+
{
108+
"dga_acq_date": "2012-01-15T00:00:00.000Z",
109+
"h2": "6.000000",
110+
"ch4": "5.000000",
111+
"c2h4": "1.000000",
112+
"c2h6": "1.000000",
113+
"c2h2": "0.000000",
114+
"co": "328.000000"
115+
},
116+
{
117+
"dga_acq_date": "2012-01-01T00:00:00.000Z",
118+
"h2": "6.000000",
119+
"ch4": "5.100000",
120+
"c2h4": "2.200000",
121+
"c2h6": "1.200000",
122+
"c2h2": "0.000000",
123+
"co": "261.299988"
124+
},
125+
{
126+
"dga_acq_date": "2011-12-01T00:00:00.000Z",
127+
"h2": "2.000000",
128+
"ch4": "4.000000",
129+
"c2h4": "1.000000",
130+
"c2h6": "1.000000",
131+
"c2h2": "0.000000",
132+
"co": "337.000000"
133+
},
134+
{
135+
"dga_acq_date": "2010-01-01T00:00:00.000Z",
136+
"h2": "4.700000",
137+
"ch4": "2.400000",
138+
"c2h4": "5.600000",
139+
"c2h6": "3.200000",
140+
"c2h2": "0.000000",
141+
"co": "148.199997"
142+
}
143+
],
144+
"fields": [
145+
{
146+
"name": "dga_acq_date",
147+
"tableID": 17410,
148+
"columnID": 1,
149+
"dataTypeID": 1114,
150+
"dataTypeSize": 8,
151+
"dataTypeModifier": -1,
152+
"format": "text"
153+
},
154+
{
155+
"name": "h2",
156+
"tableID": 0,
157+
"columnID": 0,
158+
"dataTypeID": 1700,
159+
"dataTypeSize": -1,
160+
"dataTypeModifier": 4194314,
161+
"format": "text"
162+
},
163+
{
164+
"name": "ch4",
165+
"tableID": 0,
166+
"columnID": 0,
167+
"dataTypeID": 1700,
168+
"dataTypeSize": -1,
169+
"dataTypeModifier": 4194314,
170+
"format": "text"
171+
},
172+
{
173+
"name": "c2h4",
174+
"tableID": 0,
175+
"columnID": 0,
176+
"dataTypeID": 1700,
177+
"dataTypeSize": -1,
178+
"dataTypeModifier": 4194314,
179+
"format": "text"
180+
},
181+
{
182+
"name": "c2h6",
183+
"tableID": 0,
184+
"columnID": 0,
185+
"dataTypeID": 1700,
186+
"dataTypeSize": -1,
187+
"dataTypeModifier": 4194314,
188+
"format": "text"
189+
},
190+
{
191+
"name": "c2h2",
192+
"tableID": 0,
193+
"columnID": 0,
194+
"dataTypeID": 1700,
195+
"dataTypeSize": -1,
196+
"dataTypeModifier": 4194314,
197+
"format": "text"
198+
},
199+
{
200+
"name": "co",
201+
"tableID": 0,
202+
"columnID": 0,
203+
"dataTypeID": 1700,
204+
"dataTypeSize": -1,
205+
"dataTypeModifier": 4194314,
206+
"format": "text"
207+
}
208+
],
209+
"_parsers": [null, null, null, null, null, null, null],
210+
"_types": {
211+
"_types": {
212+
"arrayParser": {},
213+
"builtins": {
214+
"BOOL": 16,
215+
"BYTEA": 17,
216+
"CHAR": 18,
217+
"INT8": 20,
218+
"INT2": 21,
219+
"INT4": 23,
220+
"REGPROC": 24,
221+
"TEXT": 25,
222+
"OID": 26,
223+
"TID": 27,
224+
"XID": 28,
225+
"CID": 29,
226+
"JSON": 114,
227+
"XML": 142,
228+
"PG_NODE_TREE": 194,
229+
"SMGR": 210,
230+
"PATH": 602,
231+
"POLYGON": 604,
232+
"CIDR": 650,
233+
"FLOAT4": 700,
234+
"FLOAT8": 701,
235+
"ABSTIME": 702,
236+
"RELTIME": 703,
237+
"TINTERVAL": 704,
238+
"CIRCLE": 718,
239+
"MACADDR8": 774,
240+
"MONEY": 790,
241+
"MACADDR": 829,
242+
"INET": 869,
243+
"ACLITEM": 1033,
244+
"BPCHAR": 1042,
245+
"VARCHAR": 1043,
246+
"DATE": 1082,
247+
"TIME": 1083,
248+
"TIMESTAMP": 1114,
249+
"TIMESTAMPTZ": 1184,
250+
"INTERVAL": 1186,
251+
"TIMETZ": 1266,
252+
"BIT": 1560,
253+
"VARBIT": 1562,
254+
"NUMERIC": 1700,
255+
"REFCURSOR": 1790,
256+
"REGPROCEDURE": 2202,
257+
"REGOPER": 2203,
258+
"REGOPERATOR": 2204,
259+
"REGCLASS": 2205,
260+
"REGTYPE": 2206,
261+
"UUID": 2950,
262+
"TXID_SNAPSHOT": 2970,
263+
"PG_LSN": 3220,
264+
"PG_NDISTINCT": 3361,
265+
"PG_DEPENDENCIES": 3402,
266+
"TSVECTOR": 3614,
267+
"TSQUERY": 3615,
268+
"GTSVECTOR": 3642,
269+
"REGCONFIG": 3734,
270+
"REGDICTIONARY": 3769,
271+
"JSONB": 3802,
272+
"REGNAMESPACE": 4089,
273+
"REGROLE": 4096
274+
}
275+
},
276+
"text": {},
277+
"binary": {}
278+
},
279+
"RowCtor": null,
280+
"rowAsArray": false
281+
}
282+
},
283+
"statusCode": "OK",
284+
"statusCodeValue": 200
285+
}

0 commit comments

Comments
 (0)