-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviewcbor.html
More file actions
36 lines (29 loc) · 952 Bytes
/
viewcbor.html
File metadata and controls
36 lines (29 loc) · 952 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
31
32
33
34
35
36
<!DOCTYPE html><html lang="ja"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width"><link rel="icon" href="data:">
<title>DFT DataViewer</title>
</head><body>
<h1>DFT DataViewer</h1>
<div id=chart1></div>
<script type="module">
import { CBOR } from "https://js.sabae.cc/CBOR.js";
import { DataViewer } from "./DataViewer.js";
//const fn = "./sekaideichiban.wav-r.cbor";
//const fn = "./sekaideichiban.wav-p.cbor";
const fn = "./sekaideichiban.wav-re.cbor";
const bin = new Uint8Array(await (await fetch(fn)).arrayBuffer());
const data = CBOR.decode(bin);
console.log(data);
const showChart = (bindto, data, data2, data3) => {
const view = new DataViewer(data);
document.getElementById(bindto.substring(1)).appendChild(view);
};
showChart("#chart1", data);
</script>
<style>
data-viewer {
display: block;
width: 100%;
height: 300px;
}
</style>
<hr>
<a href=https://github.com/code4fukui/DFT/>src on GitHub</a>