Skip to content

Commit

Permalink
feat: financial charts grouped/ungrouped comps
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanoshadjipetrou committed Jun 18, 2024
1 parent 0f83a41 commit f4f1c2f
Show file tree
Hide file tree
Showing 10 changed files with 642 additions and 204 deletions.
7 changes: 4 additions & 3 deletions src/config/mapping/budgets/breakdown.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"dataPath": "value",
"name": "<componentField>.parent.parent.name",
"name": "implementationPeriod.grant.<componentField>.name",
"value": "value",
"urlParams": "?$apply=filter(contains(indicatorName, 'reference') AND financialDataSet eq 'GrantBudget_ReferenceRate'<filterString>)/groupby((<componentField>/parent/parent/name),aggregate(plannedAmount with sum as value))",
"colors": ["#0A2840", "#013E77", "#00B5AE", "#C3EDFD", "#F3F5F4"]
"urlParams1": "?$apply=filter(contains(indicatorName, 'reference') AND financialDataSet eq 'GrantBudget_ReferenceRate'<filterString>)/groupby((implementationPeriod/grant/<componentField>/name),aggregate(plannedAmount with sum as value))",
"urlParams2": "?$apply=filter(contains(indicatorName, 'reference') AND financialDataSet eq 'GrantBudget_ReferenceRate'<filterString>)/groupby((implementationPeriod/grant/<componentField>/parent/name),aggregate(plannedAmount with sum as value))",
"colors": ["#0A2840", "#013E77", "#00B5AE", "#10708F", "#C3EDFD", "#F3F5F4"]
}
7 changes: 5 additions & 2 deletions src/config/mapping/budgets/treemap.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"dataPath": "value",
"cycle": "periodFrom",
"name": "<componentField>.parent.parent.name",
"name": "implementationPeriod.grant.<componentField>.name",
"value": "value",
"urlParams": "?$apply=filter(contains(indicatorName, 'reference') AND financialDataSet eq 'GrantBudget_ReferenceRate'<filterString>)/groupby((<componentField>/parent/parent/name),aggregate(plannedAmount with sum as value))",
"urlParams1": "?$apply=filter(contains(indicatorName, 'reference') AND financialDataSet eq 'GrantBudget_ReferenceRate'<filterString>)/groupby((implementationPeriod/grant/<componentField>/name),aggregate(plannedAmount with sum as value))",
"urlParams2": "?$apply=filter(contains(indicatorName, 'reference') AND financialDataSet eq 'GrantBudget_ReferenceRate'<filterString>)/groupby((implementationPeriod/grant/<componentField>/parent/name),aggregate(plannedAmount with sum as value))",
"url1Items": ["Malaria", "Tuberculosis"],
"url2Items": ["HIV/AIDS", "Other"],
"textbgcolors": [
{
"color": "#0A2840",
Expand Down
8 changes: 5 additions & 3 deletions src/config/mapping/disbursements/barChart.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"dataPath": "value",
"name": "<componentField>.name",
"name": "implementationPeriod.grant.<componentField>.name",
"value": "value",
"urlParams": "?$apply=filter(contains(indicatorName, 'reference') AND financialDataSet eq 'Disbursement_ReferenceRate'<filterString>)/groupby((<componentField>/name),aggregate(actualAmount with sum as value))&$orderby=value desc",
"biggerBarColor": "#00B5AE",
"urlParams1": "?$apply=filter(contains(indicatorName, 'reference') AND financialDataSet eq 'Disbursement_ReferenceRate'<filterString>)/groupby((implementationPeriod/grant/<componentField>/name),aggregate(actualAmount with sum as value))&$orderby=value desc",
"urlParams2": "?$apply=filter(contains(indicatorName, 'reference') AND financialDataSet eq 'Disbursement_ReferenceRate'<filterString>)/groupby((implementationPeriod/grant/<componentField>/parent/name),aggregate(actualAmount with sum as value))&$orderby=value desc",
"url1Items": ["Malaria", "Tuberculosis"],
"url2Items": ["HIV/AIDS", "Other"],
"barColor": "#013E77"
}
8 changes: 5 additions & 3 deletions src/config/mapping/disbursements/lineChart.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
"count": "@odata.count",
"cycle": "periodFrom",
"value": "value",
"line": "<componentField>.name",
"urlParams": "?$apply=filter(contains(indicatorName, 'reference') AND financialDataSet eq 'Disbursement_ReferenceRate'<filterString>)/groupby((periodFrom,<componentField>/name),aggregate(actualAmount with sum as value))",
"activitiesCountUrlParams": "?$count=true&$apply=filter(contains(indicatorName, 'reference') AND financialDataSet eq 'Disbursement_ReferenceRate'<filterString>)/groupby((implementationPeriod/grant/code))",
"line": "implementationPeriod.grant.<componentField>.name",
"urlParams1": "?$apply=filter(contains(indicatorName, 'reference') AND financialDataSet eq 'Disbursement_ReferenceRate'<filterString>)/groupby((periodFrom,implementationPeriod/grant/<componentField>/name),aggregate(actualAmount with sum as value))",
"urlParams2": "?$apply=filter(contains(indicatorName, 'reference') AND financialDataSet eq 'Disbursement_ReferenceRate'<filterString>)/groupby((periodFrom,implementationPeriod/grant/<componentField>/parent/name),aggregate(actualAmount with sum as value))",
"url1Items": ["Malaria", "Tuberculosis"],
"url2Items": ["HIV/AIDS", "Other"],
"colors": ["#0A2840", "#DEE1E7", "#013E77", "#00B5AE", "#C3EDFD", "#D9D9D9"]
}
7 changes: 5 additions & 2 deletions src/config/mapping/disbursements/table.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
"signedIndicator": "Total Signed Amount - Reference Rate",
"commitmentIndicator": "Total Commitment Amount - Reference Rate",
"disbursementIndicator": "Total Disbursed Amount - Reference Rate",
"component": "<componentField>.name",
"component": "implementationPeriod.grant.<componentField>.name",
"grants": "count",
"valueField": "value",
"urlParams": "?$apply=filter(indicatorName in ('Total Signed Amount - Reference Rate','Total Commitment Amount - Reference Rate','Total Disbursed Amount - Reference Rate')<filterString>)/groupby((<componentField>/name,indicatorName),aggregate(actualAmount with sum as value,implementationPeriod/grantId with countdistinct as count))&$orderby=value desc"
"urlParams1": "?$apply=filter(indicatorName in ('Total Signed Amount - Reference Rate','Total Commitment Amount - Reference Rate','Total Disbursed Amount - Reference Rate')<filterString>)/groupby((implementationPeriod/grant/<componentField>/name,indicatorName),aggregate(actualAmount with sum as value,implementationPeriod/grantId with countdistinct as count))&$orderby=value desc",
"urlParams2": "?$apply=filter(indicatorName in ('Total Signed Amount - Reference Rate','Total Commitment Amount - Reference Rate','Total Disbursed Amount - Reference Rate')<filterString>)/groupby((implementationPeriod/grant/<componentField>/parent/name,indicatorName),aggregate(actualAmount with sum as value,implementationPeriod/grantId with countdistinct as count))&$orderby=value desc",
"url1Items": ["Malaria", "Tuberculosis"],
"url2Items": ["HIV/AIDS", "Other"]
}
4 changes: 3 additions & 1 deletion src/config/mapping/expenditures/heatmap.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
"expenditure": "value1",
"cycle": "periodCovered",
"urlParams": "?$apply=filter(financialDataSet eq 'Expenditure_Intervention_ReferenceRate' AND isLatestReported eq true<filterString>)/groupby((<rowField>,<columnField>),aggregate(actualAmountCumulative with sum as value1,plannedAmountCumulative with sum as value2))",
"url1Items": ["Malaria", "Tuberculosis"],
"url2Items": ["HIV/AIDS", "Other"],
"fields": {
"principalRecipient": "implementationPeriod/grant/principalRecipient/name",
"principalRecipientSubType": "implementationPeriod/grant/principalRecipient/parent/name",
"principalRecipientType": "implementationPeriod/grant/principalRecipient/type/name",
"component": "<componentField>/parent/parent/name"
"component": "implementationPeriod/grant/<componentField>/name"
}
}
Loading

0 comments on commit f4f1c2f

Please sign in to comment.