-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathapacheArrow.html
74 lines (63 loc) · 2.2 KB
/
apacheArrow.html
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html>
<head>
<title>Apache Arrow Example</title>
<meta charset="utf-8" />
<link
href="https://fonts.googleapis.com/css?family=Roboto:300"
rel="stylesheet"
/>
<style>
body {
font-family: "Roboto", sans-serif;
margin: 2em;
}
</style>
<!-- These scripts link to the Vega runtime -->
<script src="https://cdn.jsdelivr.net/npm/vega@5"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-embed@6"></script>
<script src="https://cdn.jsdelivr.net/npm/apache-arrow"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-loader-arrow"></script>
<!-- This is the script generated from Elm -->
<script src="js/apacheArrow.js"></script>
</head>
<body>
<h1>Apache Arrow Data</h1>
<p>
<a
href="https://observablehq.com/@theneuralbit/introduction-to-apache-arrow"
target="_blank"
>Apache arrow</a
>
is a cross-platform binary format for in-memory data storage. Being much
more compact than JSON it is suitable for larger datasets as well as for
interoperability with other software that generates apache-arrow format
files:
</p>
<p>
To use Apache Arrow data with Vega (or Vega-Lite) you need to link to the
<a href="https://github.com/vega/vega-loader-arrow" target="_blank"
>vega-loader-arrow</a
>
and apache-arrow javascript packages in the head of your HTML along with
the normal links to the vega and vega-lite runtimes:
</p>
<pre>
<script src="https://cdn.jsdelivr.net/npm/apache-arrow"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-loader-arrow"></script>
</pre>
<h2>Flight Data Example</h2>
<p>Data source contains 200,000 flight records as a binary arrow file.</p>
<div id="arrow1"></div>
<script>
Elm.ApacheArrow.init().ports.elmToJS.subscribe(function (namedSpecs) {
for (let name of Object.keys(namedSpecs)) {
vegaEmbed(`#${name}`, namedSpecs[name], {
actions: false,
logLevel: vega.Warn,
}).catch(console.warn);
}
});
</script>
</body>
</html>