Skip to content

Commit

Permalink
feat(resource-group-projects): add charts for project statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
yomatters committed Aug 21, 2024
1 parent 91570a4 commit 28ba672
Show file tree
Hide file tree
Showing 12 changed files with 514 additions and 15 deletions.
70 changes: 70 additions & 0 deletions public/api/resource-groups/1/projects/all.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"projects": {
"projectType": [
{
"name": "Explore ACCESS",
"count": 354
},
{
"name": "Discover ACCESS",
"count": 191
},
{
"name": "Accelerate ACCESS",
"count": 87
},
{
"name": "Maximize ACCESS",
"count": 14
}
],
"fieldOfScience": [
{
"name": "Materials Engineering",
"count": 157
},
{
"name": "Physical Chemistry",
"count": 143
},
{
"name": "Applied Computer Science",
"count": 126
},
{
"name": "Health Sciences",
"count": 114
},
{
"name": "Ecology",
"count": 90
},
{
"name": "Training",
"count": 16
}
],
"institution": [
{
"name": "Carnegie Mellon University",
"count": 321
},
{
"name": "University of Pittsburgh",
"count": 190
},
{
"name": "University of Somewhere",
"count": 110
},
{
"name": "Another University",
"count": 16
},
{
"name": "Computing College",
"count": 9
}
]
}
}
30 changes: 30 additions & 0 deletions public/api/resource-groups/1/projects/educator.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"projects": {
"projectType": [
{
"name": "Explore ACCESS",
"count": 16
}
],
"fieldOfScience": [
{
"name": "Applied Computer Science",
"count": 10
},
{
"name": "Training",
"count": 6
}
],
"institution": [
{
"name": "Carnegie Mellon University",
"count": 8
},
{
"name": "University of Pittsburgh",
"count": 8
}
]
}
}
38 changes: 38 additions & 0 deletions public/api/resource-groups/1/projects/grad-student.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"projects": {
"projectType": [
{
"name": "Explore ACCESS",
"count": 52
}
],
"fieldOfScience": [
{
"name": "Materials Engineering",
"count": 21
},
{
"name": "Physical Chemistry",
"count": 12
},
{
"name": "Applied Computer Science",
"count": 19
}
],
"institution": [
{
"name": "University of Somewhere",
"count": 26
},
{
"name": "Another University",
"count": 22
},
{
"name": "Computing College",
"count": 4
}
]
}
}
66 changes: 66 additions & 0 deletions public/api/resource-groups/1/projects/researcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"projects": {
"projectType": [
{
"name": "Explore ACCESS",
"count": 264
},
{
"name": "Discover ACCESS",
"count": 36
},
{
"name": "Accelerate ACCESS",
"count": 9
},
{
"name": "Maximize ACCESS",
"count": 14
}
],
"fieldOfScience": [
{
"name": "Materials Engineering",
"count": 99
},
{
"name": "Physical Chemistry",
"count": 67
},
{
"name": "Applied Computer Science",
"count": 66
},
{
"name": "Health Sciences",
"count": 49
},
{
"name": "Ecology",
"count": 42
}
],
"institution": [
{
"name": "Carnegie Mellon University",
"count": 187
},
{
"name": "University of Pittsburgh",
"count": 65
},
{
"name": "University of Somewhere",
"count": 26
},
{
"name": "Another University",
"count": 36
},
{
"name": "Computing College",
"count": 9
}
]
}
}
1 change: 1 addition & 0 deletions src/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
--contrast-6: #999999;
--contrast-8: #dfdfdf;
--contrast-9: #f2f2f2;
--green-400: #288654;
--red-400: #a70000;
--orange-200: #f6d8ca;
--orange-400: #f07537;
Expand Down
39 changes: 39 additions & 0 deletions src/donut-chart.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.donut-chart svg path {
cursor: pointer;
}
.donut-chart .center-text {
align-items: center;
display: flex;
flex-direction: column;
height: 100%;
justify-content: center;
line-height: 1.2;
}
.donut-chart .center-text * {
cursor: default;
display: block;
margin-bottom: 0.25rem;
text-align: center;
}
.donut-chart .center-text .percent {
color: var(--contrast-2);
font-size: 0.7rem;
}
.donut-chart .top-items {
list-style-type: none;
margin: 0;
padding: 0;
}
.donut-chart .top-items li {
display: flex;
flex-direction: row;
margin-bottom: 5px;
}
.donut-chart .symbol {
border-radius: 8px;
display: inline-block;
height: 16px;
margin-right: 5px;
vertical-align: text-top;
width: 16px;
}
Loading

0 comments on commit 28ba672

Please sign in to comment.