-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparsing.html
More file actions
30 lines (30 loc) · 828 Bytes
/
parsing.html
File metadata and controls
30 lines (30 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Data Visualization with D3</title>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/d3/7.9.0/d3.min.js"
integrity="sha512-vc58qvvBdrDR4etbxMdlTt4GBQk1qjvyORR2nrsPsFPyrs+/u5c3+1Ct6upOgdZoIl7eq6k3a1UPDSNAQi/32A=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
</head>
<body>
<script>
d3.csv('date.csv', (d) => {
return {
date: new Date(d.date),
value: +d.value,
};
})
.then((data) => {
console.log(data);
})
.catch((error) => {
console.error('Error parsing data: ', error);
});
</script>
</body>
</html>