-
Notifications
You must be signed in to change notification settings - Fork 0
/
burtin-lite.html
63 lines (56 loc) · 1.98 KB
/
burtin-lite.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
<!DOCTYPE html>
<head>
<title>Burtin Vega-Lite</title>
<meta charset="utf-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/vega/3.0.8/vega.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vega-lite/2.0.4/vega-lite.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vega-embed/3.0.0-rc7/vega-embed.js"></script>
<!--uncomment if you decide to use advanced tooltips-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/vega-tooltip/0.4.4/vega-tooltip.js"></script>
<link rel="stylesheet" type="text/css"
href="https://cdnjs.cloudflare.com/ajax/libs/vega-tooltip/0.4.4/vega-tooltip.css">
<!--d3 and jquery might be helpful if you want to load data only once-->
<script src="https://d3js.org/d3.v4.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<style media="screen">
/* Add space between Vega-Embed links */
.vega-actions a {
margin-right: 5px;
}
</style>
</head>
<body>
<div id="chart"></div>
<script>
var opt = {"renderer":"svg","mode":"vega-lite"};
var width = 600;
var spec = {
"$schema":"https://vega.github.io/schema/vega-lite/v2.json",
"data": {
"url": "data.csv",
"format": { "type":"csv" }
},
"transform": [
{"calculate": "datum.Penicilin", "as": "dat"}
],
"mark": "bar",
"encoding": {
"row": {
"field": "Bacteria", "type": "nominal"
},
// "y": {
// "field": "Penicilin",
// "type": "quantitative"
// },
"x": {
"field": "dat",
"type": "quantitative",
"scale": {"type": "log"}
},
},
"width": width
};
vegaEmbed("#chart", spec, opt);
</script>
</body>
</html>