Skip to content

Commit

Permalink
2024 as the default year
Browse files Browse the repository at this point in the history
  • Loading branch information
GerardoFurtado committed Mar 1, 2024
1 parent 3e40bf2 commit ceb44ce
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
9 changes: 5 additions & 4 deletions assets/js/apiData.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ function LoadData() {
LoadCBPFSummary(year);
LoadAmount();
LoadDate();
const event = new CustomEvent("d3ChartsYear", {
detail: +year
});
document.body.dispatchEvent(event);
//temporarily removing until fixing 2024 summary data
// const event = new CustomEvent("d3ChartsYear", {
// detail: +year
// });
// document.body.dispatchEvent(event);
}


Expand Down
4 changes: 2 additions & 2 deletions assets/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var currentyear = d.getFullYear();
var changedYear = 0;

var minYear = 2014;
var yearToShowDataOnLoad = 2022;
var yearToShowDataOnLoad = 2024;

$(function() {
$('.annualHeading__2uJLv').text(yearToShowDataOnLoad);
Expand Down Expand Up @@ -232,7 +232,7 @@ let $underApproval_ = document.querySelector('#underApprovalFig');
let $updatedOn_ = document.querySelector('#updatedOn');
let $allocationYear = document.querySelector('.annualHeading__2uJLv');

var yearToShowDataOnLoad = 2022;
var yearToShowDataOnLoad = 2024;

fetch('https://cbpfapi.unocha.org/vo2/odata/LastModified')
.then(function(response) {
Expand Down
2 changes: 1 addition & 1 deletion charts/sankeydiagram.js
Original file line number Diff line number Diff line change
Expand Up @@ -2333,7 +2333,7 @@
};

rawDataContributions.forEach(row => {
if (chartState.selectedYear.includes(row.contributionYear) && chartState.selectedFund.includes(row.fundId) && (row.paidAmount + row.pledgedAmount)) {
if (chartState.selectedYear.includes(row.contributionYear) && chartState.selectedFund.includes(row.fundId) && (row.paidAmount + row.pledgedAmount) && +row.donorId === +row.donorId) {

const foundSource = data.nodes.find(d => d.level === 1 && d.codeId === row.donorId);

Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ <h1 class="font-weight-bold mb-2 mt-5 font-3rem"><span style="color: #ffc417;">C
</div>
<div class="row">
<div class="border-top pt-3">
<div id="d3chartcontainercesank" data-title=" " data-year="2022" data-responsive="false" data-lazyload="true"></div><script type="text/javascript" src="charts/sankeydiagram.js"></script>
<div id="d3chartcontainercesank" data-title=" " data-year="2024" data-responsive="false" data-lazyload="true"></div><script type="text/javascript" src="charts/sankeydiagram.js"></script>
</div>
</div>
</div>
Expand All @@ -201,7 +201,7 @@ <h1 class="font-weight-bold mb-2 mt-5 font-3rem"><span style="color: #ffc417;">C
</ul>
<div class="tab-content border-top pt-3" id="myTabContent">
<div class="tab-pane active show" id="allocation-overview" role="tabpanel" aria-labelledby="allocation-overview-tab">
<div><div id="d3chartcontainerallocover" data-title=" " data-year="2022" data-cerfallocation="total" data-shownames="false" data-showhelp="false" data-showlink="false" data-responsive="true" data-lazyload="true"></div><script type="text/javascript" src="charts/allocationsoverview.js"></script></div>
<div><div id="d3chartcontainerallocover" data-title=" " data-year="2024" data-cerfallocation="total" data-shownames="false" data-showhelp="false" data-showlink="false" data-responsive="true" data-lazyload="true"></div><script type="text/javascript" src="charts/allocationsoverview.js"></script></div>
</div>
</div>
</div>
Expand Down

0 comments on commit ceb44ce

Please sign in to comment.