-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_chart.html
41 lines (38 loc) · 5 KB
/
main_chart.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
<!DOCTYPE html>
<html>
<head>
<style>
#vis.vega-embed {
width: 100%;
display: flex;
}
#vis.vega-embed details,
#vis.vega-embed details summary {
position: relative;
}
</style>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/vega@5"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/vega-embed@6"></script>
</head>
<body>
<div id="vis"></div>
<script>
(function(vegaEmbed) {
var spec = {"config": {"view": {"continuousWidth": 300, "continuousHeight": 300}}, "data": {"name": "data-789d2b3d6db66a439d25344a115e7297"}, "mark": {"type": "line", "point": true}, "encoding": {"color": {"field": "type", "type": "nominal"}, "tooltip": [{"field": "year", "type": "quantitative"}, {"field": "type", "type": "nominal"}, {"field": "count", "type": "quantitative"}], "x": {"field": "year", "type": "ordinal"}, "y": {"field": "count", "type": "quantitative"}}, "height": 400, "title": "Research Output CS (2019 onwards)", "width": 600, "$schema": "https://vega.github.io/schema/vega-lite/v5.17.0.json", "datasets": {"data-789d2b3d6db66a439d25344a115e7297": [{"year": 2019, "type": "article", "count": 65, "change": null, "pct_change": null}, {"year": 2019, "type": "book-chapter", "count": 5, "change": null, "pct_change": null}, {"year": 2019, "type": "book", "count": 3, "change": null, "pct_change": null}, {"year": 2019, "type": "thesis", "count": 20, "change": null, "pct_change": null}, {"year": 2019, "type": "conference-proceeding", "count": 105, "change": null, "pct_change": null}, {"year": 2019, "type": "other", "count": 16, "change": null, "pct_change": null}, {"year": 2020, "type": "other", "count": 36, "change": null, "pct_change": null}, {"year": 2020, "type": "conference-proceeding", "count": 142, "change": 37.0, "pct_change": 35.23809523809525}, {"year": 2020, "type": "book", "count": 1, "change": null, "pct_change": null}, {"year": 2020, "type": "book-chapter", "count": 19, "change": null, "pct_change": null}, {"year": 2020, "type": "article", "count": 86, "change": 21.0, "pct_change": 32.30769230769231}, {"year": 2020, "type": "thesis", "count": 7, "change": null, "pct_change": null}, {"year": 2021, "type": "book", "count": 1, "change": null, "pct_change": null}, {"year": 2021, "type": "article", "count": 139, "change": 53.0, "pct_change": 61.627906976744185}, {"year": 2021, "type": "thesis", "count": 12, "change": null, "pct_change": null}, {"year": 2021, "type": "other", "count": 43, "change": null, "pct_change": null}, {"year": 2021, "type": "conference-proceeding", "count": 174, "change": 32.0, "pct_change": 22.535211267605625}, {"year": 2021, "type": "book-chapter", "count": 14, "change": null, "pct_change": null}, {"year": 2022, "type": "thesis", "count": 9, "change": null, "pct_change": null}, {"year": 2022, "type": "other", "count": 54, "change": null, "pct_change": null}, {"year": 2022, "type": "book-chapter", "count": 16, "change": null, "pct_change": null}, {"year": 2022, "type": "conference-proceeding", "count": 156, "change": -18.0, "pct_change": -10.344827586206895}, {"year": 2022, "type": "book", "count": 1, "change": null, "pct_change": null}, {"year": 2022, "type": "article", "count": 124, "change": -15.0, "pct_change": -10.79136690647482}, {"year": 2023, "type": "article", "count": 143, "change": 19.0, "pct_change": 15.322580645161299}, {"year": 2023, "type": "thesis", "count": 19, "change": null, "pct_change": null}, {"year": 2023, "type": "book-chapter", "count": 21, "change": null, "pct_change": null}, {"year": 2023, "type": "conference-proceeding", "count": 204, "change": 48.0, "pct_change": 30.76923076923077}, {"year": 2023, "type": "book", "count": 2, "change": null, "pct_change": null}, {"year": 2023, "type": "other", "count": 57, "change": null, "pct_change": null}, {"year": 2024, "type": "thesis", "count": 7, "change": null, "pct_change": null}, {"year": 2024, "type": "book", "count": 1, "change": null, "pct_change": null}, {"year": 2024, "type": "conference-proceeding", "count": 255, "change": 51.0, "pct_change": 25.0}, {"year": 2024, "type": "article", "count": 264, "change": 121.0, "pct_change": 84.61538461538463}, {"year": 2024, "type": "book-chapter", "count": 14, "change": null, "pct_change": null}, {"year": 2024, "type": "other", "count": 51, "change": null, "pct_change": null}]}};
var embedOpt = {"mode": "vega-lite"};
function showError(el, error){
el.innerHTML = ('<div style="color:red;">'
+ '<p>JavaScript Error: ' + error.message + '</p>'
+ "<p>This usually means there's a typo in your chart specification. "
+ "See the javascript console for the full traceback.</p>"
+ '</div>');
throw error;
}
const el = document.getElementById('vis');
vegaEmbed("#vis", spec, embedOpt)
.catch(error => showError(el, error));
})(vegaEmbed);
</script>
</body>
</html>