Skip to content

Commit

Permalink
remove unused dependencies and in-repo included js libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
M4GNV5 committed May 31, 2022
1 parent b9969dc commit d6af212
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 22 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*.json
web/assets/leaflet.*
web/assets/leaflet*
web/assets/moment*
web/assets/chart*
7 changes: 5 additions & 2 deletions preparedata.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python3

import os, re, json, demjson, datetime, urllib.request
import os, re, json, datetime, urllib.request

# you can obtain the county-centres-bavaria.json file by running the following
# query on overpass-turbo.eu and export the result as GeoJSON
Expand Down Expand Up @@ -81,5 +81,8 @@
with open("web/history/{}.json".format(timestamp), "w+", encoding="utf-8") as fd:
json.dump(bavariaData, fd, indent=4)

os.unlink("web/data.json")
try:
os.unlink("web/data.json")
except:
pass
os.symlink("history/{}.json".format(timestamp), "web/data.json")
7 changes: 0 additions & 7 deletions web/assets/Chart.min.js

This file was deleted.

7 changes: 0 additions & 7 deletions web/assets/moment.min.js

This file was deleted.

6 changes: 4 additions & 2 deletions web/graph.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@

<canvas></canvas>

<script src="assets/moment.min.js"></script>
<script src="assets/Chart.min.js"></script>
<!-- e.g. https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.3/moment.min.js -->
<script src="assets/moment-2.29.3.js"></script>
<!-- e.g. https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.bundle.min.js -->
<script src="assets/chart-2.9.3.js"></script>
<script src="assets/graph.js"></script>
</body>
</html>
7 changes: 4 additions & 3 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
<meta property="twitter:image" content="https://corona.bayern/assets/bayern-corona.png" />
<meta property="twitter:title" content="Corona in Bayern" />

<link rel="stylesheet" href="assets/leaflet.css" />
<!-- e.g. https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.4/leaflet.css -->
<link rel="stylesheet" href="assets/leaflet-1.3.4.css" />

<style>
#info {
Expand Down Expand Up @@ -113,8 +114,8 @@
<a href="/graph.html">Historie</a>
</div>

<script src="assets/leaflet.js"></script>
<script src="assets/semicircle.js"></script>
<!-- e.g. https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.3.4/leaflet.js -->
<script src="assets/leaflet-1.3.4.js"></script>
<script src="assets/script.js"></script>
</body>
</html>

0 comments on commit d6af212

Please sign in to comment.