-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
49 lines (49 loc) · 1.41 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
</head>
<body>
<div id="vis"/>
<script>
const spec = {
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"title": "Heatmap of Correlation Matrix",
"width": 400,
"height": 300,
"data": {
"url": "https://raw.githubusercontent.com/sz0314/life_expansion/main/correlation_matrix.csv"
},
"layer": [
{
"mark": {"type": "rect", "tooltip": true},
"encoding": {
"x": {"field": "row", "type": "nominal", "axis": {"title": null}},
"y": {"field": "col", "type": "nominal", "axis": {"title": null}},
"color": {"field": "value", "type": "quantitative", "title": null}
}
},
{
"mark": {
"type": "text",
"align": "center",
"baseline": "middle",
"fontSize": 10,
"color": "black",
"tooltip": true
},
"encoding": {
"x": {"field": "row", "type": "nominal"},
"y": {"field": "col", "type": "nominal"},
"text": {"field": "value", "type": "quantitative", "format": ".2f"}
}
}
],
"config": {"mark": {"tooltip": null}}
};
vegaEmbed("#vis", spec, {mode: "vega-lite"}).then(console.log).catch(console.warn);
</script>
</body>
</html>