forked from adieyal/vulekamali-viz-sandbox
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index_econ4.html
34 lines (29 loc) · 12.2 KB
/
index_econ4.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="main.css"/>
<link rel="stylesheet" href="econ4.css"/>
<style>
#my_dataviz {
display: inline-block;
position: relative;
width: 100%;
padding-bottom: 100%; /* aspect ratio */
vertical-align: top;
overflow: hidden;
overflow-y: scroll;
}
</style>
<!-- Load d3.js -->
<script src="https://d3js.org/d3.v4.js"></script>
<script src="elements.js"></script>
<script src="utils.js"></script>
<div id="my_dataviz" class="department-econ4"
data-aggregate-url="https://openspending.org/api/3/cubes/b9d2af843f3a7ca223eea07fb608e62a:estimates-of-national-expenditure-2019-20-uploaded-2019-02-20t1910/aggregate/?pagesize=10000&cut=budget_phase.budget_phase%3AMain+appropriation%7Cfinyear.finyear%3A2019%7Cvoteno.department%3APublic+Service+and+Administration&drilldown=econ4.econ4%7Cprogno.programme%7Csprogno.subprogramme"
data-openspending-model="{"aggregates": {"value.sum": {"function": "sum", "measure": "value", "ref": "value.sum", "label": "Value"}, "_count": {"function": "count", "ref": "_count", "label": "Facts"}}, "hierarchies": {"phase": {"levels": ["budget_phase"], "ref": "phase", "label": "phase"}, "economic_classification": {"levels": ["econ1", "econ2", "econ3", "econ4", "econ5"], "ref": "economic_classification", "label": "economic_classification"}, "activity": {"levels": ["progno", "sprogno"], "ref": "activity", "label": "activity"}, "date": {"levels": ["finyear"], "ref": "date", "label": "date"}, "administrative_classification": {"levels": ["voteno"], "ref": "administrative_classification", "label": "administrative_classification"}, "functional_classification": {"levels": ["fg1", "fg2"], "ref": "functional_classification", "label": "functional_classification"}}, "measures": {"value": {"column": "value", "ref": "value", "type": "number", "label": "Value"}}, "dimensions": {"econ3": {"hierarchy": "economic_classification", "ref": "econ3", "key_attribute": "econ3", "label": "Econ3", "cardinality_class": null, "key_ref": "econ3.econ3", "attributes": {"econ3": {"column": "b9d2af843f3a7ca223eea07fb608e62a46912ff1719d9a91_3.econ3", "ref": "econ3.econ3", "type": "string", "label": "Econ3"}}, "label_attribute": "econ3", "join_column": ["economic_classification_id", "_fdp__id_"], "label_ref": "econ3.econ3"}, "budget_phase": {"hierarchy": "phase", "ref": "budget_phase", "key_attribute": "budget_phase", "label": "Budget Phase", "cardinality_class": null, "key_ref": "budget_phase.budget_phase", "attributes": {"budget_phase": {"column": "b9d2af843f3a7ca223eea07fb608e62a46912ff1719d9a91_5.budget_phase", "ref": "budget_phase.budget_phase", "type": "string", "label": "Budget Phase"}}, "label_attribute": "budget_phase", "join_column": ["phase_id", "_fdp__id_"], "label_ref": "budget_phase.budget_phase"}, "voteno": {"hierarchy": "administrative_classification", "label_attribute": "department", "key_attribute": "voteno", "label": "VoteNo", "cardinality_class": null, "key_ref": "voteno.voteno", "attributes": {"department": {"column": "b9d2af843f3a7ca223eea07fb608e62a46912ff1719d9a91_1.department", "ref": "voteno.department", "type": "string", "label": "Department"}, "voteno": {"column": "b9d2af843f3a7ca223eea07fb608e62a46912ff1719d9a91_1.voteno", "ref": "voteno.voteno", "type": "string", "label": "VoteNo"}}, "ref": "voteno", "join_column": ["administrative_classification_id", "_fdp__id_"], "label_ref": "voteno.department"}, "progno": {"hierarchy": "activity", "label_attribute": "programme", "key_attribute": "progno", "label": "ProgNo", "cardinality_class": null, "key_ref": "progno.progno", "attributes": {"programme": {"column": "b9d2af843f3a7ca223eea07fb608e62a46912ff1719d9a91_0.programme", "ref": "progno.programme", "type": "string", "label": "Programme"}, "progno": {"column": "b9d2af843f3a7ca223eea07fb608e62a46912ff1719d9a91_0.progno", "ref": "progno.progno", "type": "string", "label": "ProgNo"}}, "ref": "progno", "join_column": ["activity_id", "_fdp__id_"], "label_ref": "progno.programme"}, "fg1": {"hierarchy": "functional_classification", "ref": "fg1", "key_attribute": "fg1", "label": "FG1", "cardinality_class": null, "key_ref": "fg1.fg1", "attributes": {"fg1": {"column": "b9d2af843f3a7ca223eea07fb608e62a46912ff1719d9a91_4.fg1", "ref": "fg1.fg1", "type": "string", "label": "FG1"}}, "label_attribute": "fg1", "join_column": ["functional_classification_id", "_fdp__id_"], "label_ref": "fg1.fg1"}, "fg2": {"hierarchy": "functional_classification", "ref": "fg2", "key_attribute": "fg2", "label": "FG2", "cardinality_class": null, "key_ref": "fg2.fg2", "attributes": {"fg2": {"column": "b9d2af843f3a7ca223eea07fb608e62a46912ff1719d9a91_4.fg2", "ref": "fg2.fg2", "type": "string", "label": "FG2"}}, "label_attribute": "fg2", "join_column": ["functional_classification_id", "_fdp__id_"], "label_ref": "fg2.fg2"}, "sprogno": {"hierarchy": "activity", "label_attribute": "subprogramme", "key_attribute": "sprogno", "label": "SprogNo", "cardinality_class": null, "key_ref": "sprogno.sprogno", "attributes": {"subprogramme": {"column": "b9d2af843f3a7ca223eea07fb608e62a46912ff1719d9a91_0.subprogramme", "ref": "sprogno.subprogramme", "type": "string", "label": "Subprogramme"}, "sprogno": {"column": "b9d2af843f3a7ca223eea07fb608e62a46912ff1719d9a91_0.sprogno", "ref": "sprogno.sprogno", "type": "string", "label": "SprogNo"}}, "ref": "sprogno", "join_column": ["activity_id", "_fdp__id_"], "label_ref": "sprogno.subprogramme"}, "econ1": {"hierarchy": "economic_classification", "ref": "econ1", "key_attribute": "econ1", "label": "Econ1", "cardinality_class": null, "key_ref": "econ1.econ1", "attributes": {"econ1": {"column": "b9d2af843f3a7ca223eea07fb608e62a46912ff1719d9a91_3.econ1", "ref": "econ1.econ1", "type": "string", "label": "Econ1"}}, "label_attribute": "econ1", "join_column": ["economic_classification_id", "_fdp__id_"], "label_ref": "econ1.econ1"}, "econ2": {"hierarchy": "economic_classification", "ref": "econ2", "key_attribute": "econ2", "label": "Econ2", "cardinality_class": null, "key_ref": "econ2.econ2", "attributes": {"econ2": {"column": "b9d2af843f3a7ca223eea07fb608e62a46912ff1719d9a91_3.econ2", "ref": "econ2.econ2", "type": "string", "label": "Econ2"}}, "label_attribute": "econ2", "join_column": ["economic_classification_id", "_fdp__id_"], "label_ref": "econ2.econ2"}, "finyear": {"hierarchy": "date", "ref": "finyear", "key_attribute": "finyear", "label": "FinYear", "cardinality_class": null, "key_ref": "finyear.finyear", "attributes": {"finyear": {"column": "b9d2af843f3a7ca223eea07fb608e62a46912ff1719d9a91_2.finyear", "ref": "finyear.finyear", "type": "integer", "label": "FinYear"}}, "label_attribute": "finyear", "join_column": ["date_id", "_fdp__id_"], "label_ref": "finyear.finyear"}, "econ4": {"hierarchy": "economic_classification", "ref": "econ4", "key_attribute": "econ4", "label": "Econ4", "cardinality_class": null, "key_ref": "econ4.econ4", "attributes": {"econ4": {"column": "b9d2af843f3a7ca223eea07fb608e62a46912ff1719d9a91_3.econ4", "ref": "econ4.econ4", "type": "string", "label": "Econ4"}}, "label_attribute": "econ4", "join_column": ["economic_classification_id", "_fdp__id_"], "label_ref": "econ4.econ4"}, "econ5": {"hierarchy": "economic_classification", "ref": "econ5", "key_attribute": "econ5", "label": "Econ5", "cardinality_class": null, "key_ref": "econ5.econ5", "attributes": {"econ5": {"column": "b9d2af843f3a7ca223eea07fb608e62a46912ff1719d9a91_3.econ5", "ref": "econ5.econ5", "type": "string", "label": "Econ5"}}, "label_attribute": "econ5", "join_column": ["economic_classification_id", "_fdp__id_"], "label_ref": "econ5.econ5"}}, "fact_table": "b9d2af843f3a7ca223eea07fb608e62a46912ff1719d9a91"}"
>
</div>
<script src="openspending.js"></script>
<script src="vulekamali-openspending.js"></script>
<script src="dept-econ4.js"></script>
<script src="saveSvgAsPng.js"></script>