Skip to content

Commit

Permalink
Make changs according to SW comments; old d3 does not allow for stack…
Browse files Browse the repository at this point in the history
…ing bars, so, I stack bars a different way.
  • Loading branch information
doprdele committed Jul 22, 2024
1 parent 36fe66f commit 2ae1f45
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion assets/data/dss/metrics_by_department.csv
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ FY24,Other,3
FY24,Psychology,25
FY24,SEAS,2
FY24,Sociology,9
FY24,WCFIA,1
FY24,WCFIA,1
2 changes: 1 addition & 1 deletion assets/data/dss/metrics_by_department_cumulative.csv
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,4 @@ HMS,FY24_Q4,5,54
HSPH,FY24_Q4,11,168
MIT,FY24_Q4,10,101
Psychology,FY24_Q4,3,66
Sociology,FY24_Q4,2,61
Sociology,FY24_Q4,2,61
2 changes: 1 addition & 1 deletion assets/data/dss/metrics_by_quarter.csv
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ FY23,FY23_Q4,64
FY24,FY24_Q1,69
FY24,FY24_Q2,58
FY24,FY24_Q3,81
FY24,FY24_Q4,48
FY24,FY24_Q4,48
20 changes: 9 additions & 11 deletions assets/js/dss_plots.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ function colorMemo(financial_year) {

function dssOverview() {
d3.tsv(path + "overview.tsv", function (error, data) {
console.log(error);
for (d of data) {
dssAddMetric(d, "dssOverview", "col-sm-6 col-xs-12 col-md-6 col-lg-4 col-xl-3")
}
Expand Down Expand Up @@ -76,7 +75,7 @@ function year_quarter() {
"value": "unique_tickets",
"label": "Number of Help requests"
})
.color((d) => { return colorMemo(d.fyear_quarter) } )
.color((d) => { return colorMemo(d.financial_year) } )
.font({
"family": fontFamily
})
Expand Down Expand Up @@ -115,7 +114,7 @@ function timeSeriesCommunity() {
"value": "cumulative_tickets",
"label": "Cumulative Requests"
})
.legend(false)
.legend(true)
.font({
"family": fontFamily
})
Expand Down Expand Up @@ -144,7 +143,7 @@ function patron_community() {
.container("." + div)
.data(myNumData)
.type("bar")
.id(["patron_community", "financial_year"])
.id(["financial_year","patron_community"])
.y({
"value": "patron_community",
"scale": "discrete",
Expand All @@ -155,11 +154,10 @@ function patron_community() {
"label": "Number of Help Requests",
})
.order({
"sort": "asc",
"value": "unique_tickets"
"sort": "desc",
"value": "financial_year",
})
.legend(false)
.color((d) => iqss_color_pallette[Math.floor(Math.random() * iqss_color_pallette.length)]) // iqss_color_pallette[Math.floor(Math.random() * iqss_color_pallette.length)]))
.color((d) => colorMemo(d.financial_year))
.font({
"family": fontFamily,
"transform": "none"
Expand Down Expand Up @@ -188,7 +186,7 @@ function request_type() {
.container("." + div)
.data(myNumData)
.type("bar")
.id(["request_type","financial_year"])
.id(["financial_year", "request_type"])
.x({
"value": "total_count",
"label": "Number of Help Requests"
Expand All @@ -202,12 +200,12 @@ function request_type() {
"sort": "asc",
"value": "total_count"
})
.color((d) => { return Array.isArray(d.financialYearColor) ? d.financialYearColor.at(-1) : d.financialYearColor })
.color((d) => colorMemo(d.financial_year))
.font({
"family": fontFamily,
"transform": "none"
})
.legend(false)
.legend(true)
.resize(true)
.draw()
});
Expand Down
10 changes: 5 additions & 5 deletions data-science-services.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
---
{% include templates.html %}

<h3>Overview</h3>
<!-- FIXME: FY24 should be parameterized eventually based on the latest year of data availableK -->
<h3>Overview FY24</h3>
<div id="dssOverview" class="row"></div>

<h3 id="consulting_services">Help requests</h3>
<div class="row">
{% include card-d3.html grid_class = "col-md-6" title = "Total number of Help requests" div = "totalNumHelpRequests" %}
{% include card-d3.html grid_class = "col-md-6" title = "Help Requests by Department" div = "helpRequestsByDepartment" %}
{% include card-d3.html grid_class = "col-md-6" title = "Help Requests by Department Cumulatively" div = "helpRequestsByDepartmentCm" %}
{% include card-d3.html grid_class = "col-md-6" title = "Help Requests by Type of Request" div = "helpRequestsByType" %}
{% include card-d3.html grid_class = "col-md-6" title = "Help Requests by Department (FY21 - FY24)" div = "helpRequestsByDepartment" %}
{% include card-d3.html grid_class = "col-md-6" title = "Help Requests by Top 8 Departments Cumulatively" div = "helpRequestsByDepartmentCm" %}
{% include card-d3.html grid_class = "col-md-6" title = "Help Requests by Type of Request (FY21 - FY24)" div = "helpRequestsByType" %}
</div>

<!-- <script src="https://d3plus.org/js/d3plus.js"></script> -->
<script src="{{site.baseurl}}assets/js/plot.js"></script>
<script src="{{site.baseurl}}assets/js/dss_plots.js"></script>

0 comments on commit 2ae1f45

Please sign in to comment.