Skip to content

Commit 0f51067

Browse files
authored
Merge pull request #357 from cmu-delphi/sgratzl/epivis_prep
Add EpiVis
2 parents 58ed66c + f26229b commit 0f51067

File tree

10 files changed

+56
-5
lines changed

10 files changed

+56
-5
lines changed

content/epivis/_index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: EPIVis
3+
description: EpiVis is an interactive tool for visualizing epidemiological time-series data.
4+
layout: epivis_app
5+
order: 1
6+
feedback: true
7+
footer: false
8+
---

content/tools/epivis.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: EpiVis
3-
link: https://delphi.cmu.edu/epivis/epivis.html
3+
link: /epivis/
44
order: 1
55
---
66

package-lock.json

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"highlight.js": "^10.7.2",
88
"katex": "^0.13.11",
99
"uikit": "^3.6.22",
10-
"www-covidcast": "https://github.com/cmu-delphi/www-covidcast/releases/download/v2.4.0/www-covidcast-2.4.0.tgz"
10+
"www-covidcast": "https://github.com/cmu-delphi/www-covidcast/releases/download/v2.4.0/www-covidcast-2.4.0.tgz",
11+
"www-epivis": "github:cmu-delphi/www-epivis#dev"
1112
},
1213
"devDependencies": {
1314
"hugo-bin": "^0.71.1",
@@ -25,7 +26,8 @@
2526
"clean": "rimraf \"*.tgz\" public",
2627
"copy_fonts": "shx cp -r \"node_modules/katex/dist/fonts/*\" themes/delphi/static/css/fonts/",
2728
"copy_covidcast": "shx rm -rf \"static/covidcast/*\" && shx cp \"node_modules/www-covidcast/public/**/*.{js,txt,css,map}\" static/covidcast/",
28-
"postinstall": "npm run copy_fonts && npm run copy_covidcast",
29+
"copy_epivis": "shx rm -rf \"static/epivis/*\" && shx cp \"node_modules/www-epivis/public/**/*.{js,txt,css,map}\" static/epivis/",
30+
"postinstall": "npm run copy_fonts && npm run copy_covidcast && npm run copy_epivis",
2931
"build:blog": "Rscript -e \"blogdown::build_site(local=FALSE, run_hugo=FALSE, build_rmd='md5sum')\"",
3032
"prebuild": "npm run clean",
3133
"build": "hugo --gc --minify",

static/covidcast/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*.js
22
*.txt
33
*.html
4-
*.css
4+
*.css
5+
*.map

static/epivis/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.js
2+
*.txt
3+
*.html
4+
*.css
5+
*.map

themes/delphi/assets/css/pages/_covidcast.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
#vizbox {
1+
#vizbox,
2+
#epivis {
23
margin-top: 5px !important;
34
}
45

6+
#epivis {
7+
flex-grow: 1;
8+
}
9+
510
.covidcast_wrapper {
611
display: flex;
712
flex-direction: column;

themes/delphi/assets/js/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ UIkit.use(plugin);
77
window.UIkit = UIkit;
88
// define for covidcast at which base url it is embedded
99
window.DELPHI_COVIDCAST_PAGE = "/covidcast/";
10+
// define for covidcast at which base url it is embedded
11+
window.DELPHI_EPIVIS_PAGE = "/epivis/";
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{ define "styles" }}
2+
<link rel="stylesheet" href="{{ (partial "epivis/find-file.html" "bundle.*\\.css$")| relURL }}" />
3+
{{ end }}
4+
{{ define "scripts" }}
5+
<script src="{{ (partial "epivis/find-file.html" "bundle.*\\.js$")| relURL }}"></script>
6+
{{ end }}
7+
{{ define "breadcrumb" }}<!-- no breadcrumb -->{{ end }}
8+
{{ define "body_class" }}{{ if eq .Params.footer false }}covidcast_wrapper{{ end }}{{ end }}
9+
{{ define "main" }}
10+
<div id="epivis"></div>
11+
{{ end }}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!--find a file given a prefix and directory -->
2+
{{ $pattern := . }}
3+
{{ $matchedFile := false }}
4+
{{ range (readDir "./static/epivis") }}
5+
{{ $testFile := . }}
6+
{{ with (index (findRE $pattern .Name 1) 0) }}
7+
{{ $matchedFile = path.Join "./epivis" $testFile.Name }}
8+
{{ end }}
9+
{{ end }}
10+
{{ return $matchedFile }}

0 commit comments

Comments
 (0)