Skip to content

Commit 2608943

Browse files
authored
Merge pull request #474 from devinit/development
release/v3.4.3
2 parents a40b56f + 3a28bf5 commit 2608943

File tree

12 files changed

+69
-23
lines changed

12 files changed

+69
-23
lines changed
50.7 KB
Loading
216 KB
Loading

docs/visualisations.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# DDH Visualisations
2+
This file documents all DDH visualisations, explainining their purpose, where they get their data, and where you can find them in the code.
3+
4+
## Global Picture
5+
|Option|Value|
6+
|------------|------------------------------------------------------------------------------------|
7+
|URL| http://data.devinit.org/[global-picture]|
8+
|Concept File| https://github.com/devinit/datahub-cms/blob/development/global-picture/concept.csv|
9+
10+
## Ranking Tables
11+
12+
![RankingTables](/docs/assets/global-picture-ranking-tables.png)
13+
14+
|Option|Value|
15+
|------------|------------------------------------------------------------------------------------|
16+
|Code Path| src/components/molecules/Maps/Map/index.tsx|
17+
|GitHub Code Path|https://github.com/devinit/datahub/blob/master/src/components/molecules/Maps/Map/index.tsx#L158|
18+
19+
## Country Profiles
20+
|Option|Value|
21+
|------------|------------------------------------------------------------------------------------|
22+
|URL template| http://data.devinit.org/country/[country-slug]|
23+
|Concept File| https://github.com/devinit/datahub-cms/blob/development/country-profile/concept.csv|
24+
25+
### Overview Tab -> Poorest People
26+
27+
![PoorestPeople](/docs/assets/country-profile-overview-poorest-people.png)
28+
29+
|Option|Value|
30+
|------------------|----------------------------------------------------------------------------------|
31+
|DDW table/Concept ID|data_series.poorest_20_percent|
32+
|SQL query|https://github.com/devinit/datahub-api/blob/master/src/modules/dw/CountryProfile/sql.ts#L15|
33+
|Code Path|https://github.com/devinit/datahub/tree/development/src/components/molecules/CountryProfileTabs/Overview|

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "@devinit/dh-app",
3-
"version": "3.4.2",
3+
"version": "3.4.3",
44
"config": {
5-
"API": "http://212.111.41.68:3000/graphql",
5+
"API": "http://212.111.41.68:9090/graphql",
66
"API_DEV": "http://212.111.41.68:9090/graphql",
77
"PUPPETEER_SKIP_CHROMIUM_DOWNLOAD": true,
88
"OLD_DATAHUB_URL": "http://212.111.41.68:8888"

src/components/MethodologyData/country-profile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export default {
6767
{
6868
name: 'Depth of extreme poverty (poverty gap)',
6969
description:
70-
'Depth of extreme poverty (also known as the poverty gap) tells us how far people are from the extreme poverty line, on average per country. Data is for 2013',
70+
'Depth of extreme poverty (also known as the poverty gap) tells us how far people are from the extreme poverty line, on average per country. Data is for 2015',
7171
methodology: '',
7272
uom: 'percent',
7373
csv:

src/components/atoms/BaseMap/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ export interface State {
3939
profileLoading: boolean; // think loading new country on map click
4040
shouldForceRedraw: boolean;
4141
}
42-
export const indicatorsWith2dp = [ 'fact.oda_to_ldcs_percent_gni', 'fact.oda_percent_gni' ];
42+
export const indicatorsWith2dp = [
43+
'fact.oda_to_ldcs_percent_gni',
44+
'fact.oda_percent_gni',
45+
'data_series.climate_vulnerability'
46+
];
4347

4448
export const indicatorsWith0dp = [
4549
'spotlightonuganda.ugandaurbanpop',

src/components/molecules/Maps/Map/index.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,7 @@ class Map extends React.Component<Props, State> {
155155
</Intro>
156156
</Grid.Column>
157157
</Grid.Row>
158-
{
159-
!this.noRankTableList.includes(this.meta.id)
160-
? <RankingsTable { ...this.setCountryRankData() } router={ this.props.router } /> : ''
161-
}
158+
{ this.renderRankingsTable() }
162159
</Grid>
163160
</Container>
164161
);
@@ -182,6 +179,14 @@ class Map extends React.Component<Props, State> {
182179
}
183180
}
184181

182+
renderRankingsTable() {
183+
if (!this.noRankTableList.includes(this.meta.id)) {
184+
return <RankingsTable { ...this.setCountryRankData() } router={ this.props.router } />;
185+
}
186+
187+
return null;
188+
}
189+
185190
init(props: Props) {
186191
this.initYearSetup(props);
187192
this.initMetaSetup(props);
@@ -268,7 +273,7 @@ class Map extends React.Component<Props, State> {
268273

269274
return { name, value, flagUrl, uid: obj.uid || '', position: (index + 1), route, uom };
270275
});
271-
const top = sortedData.slice(0, 10).map(obj => {
276+
const largest = sortedData.slice(0, 10).map(obj => {
272277
if (Number(obj.value) > 10000) {
273278
return { ...obj, value: Number(obj.value).toFixed(0) };
274279
}
@@ -278,11 +283,11 @@ class Map extends React.Component<Props, State> {
278283

279284
return obj;
280285
});
281-
const bottom = sortedData.slice(-10);
286+
const smallest = sortedData.slice(-10);
282287

283288
return {
284289
hasflags: this.country === 'global',
285-
data: { top, bottom }
290+
data: { largest, smallest }
286291
};
287292
}
288293

src/components/molecules/RankingsTable/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ export interface Props {
2525
hasflags: boolean;
2626
router?: SingletonRouter;
2727
data: {
28-
top: Data[];
29-
bottom: Data[];
28+
largest: Data[];
29+
smallest: Data[];
3030
};
3131
}
3232

src/components/organisms/UnbundlingAid/data-oda.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -320,14 +320,14 @@ export default {
320320
{ id: 'multilateral', name: 'Multilateral' },
321321
{ id: 'private-sector-institution', name: 'Private Sector Institution' },
322322
{ id: 'ngo-unknown', name: 'NGO (unknown)' },
323-
{
324-
id: 'university-research-institute-etc',
325-
name: 'University, research institute or think-tank, etc'
326-
},
327323
{
328324
id: 'public-sector-recipient',
329325
name: 'Public sector (recipient government)'
330326
},
327+
{
328+
id: 'university-research-institute-etc',
329+
name: 'University, research institute or think-tank, etc'
330+
},
331331
{ id: 'unspecified', name: 'Unspecified' },
332332
{
333333
id: 'ppps-and-networks',
@@ -336,26 +336,26 @@ export default {
336336
{ id: 'other', name: 'Other' }
337337
],
338338
sectors: [
339+
{ id: 'humanitarian', name: 'Humanitarian' },
339340
{
340341
id: 'agriculture-and-food-security',
341342
name: 'Agriculture and food security'
342343
},
343-
{ id: 'humanitarian', name: 'Humanitarian' },
344344
{ id: 'water-and-sanitation', name: 'Water and sanitation' },
345345
{ id: 'general-budget-support', name: 'General budget support' },
346346
{ id: 'education', name: 'Education' },
347347
{ id: 'health', name: 'Health' },
348+
{ id: 'other-social-services', name: 'Other social services' },
348349
{
349350
id: 'governance-security-and-civil-society',
350351
name: 'Governance, security and civil society'
351352
},
352-
{ id: 'other-social-services', name: 'Other social services' },
353353
{ id: 'debt-relief', name: 'Debt relief' },
354354
{ id: 'infrastructure', name: 'Infrastructure' },
355355
{ id: 'environment', name: 'Environment' },
356356
{ id: 'banking-and-business', name: 'Banking and business' },
357-
{ id: 'industry-and-trade', name: 'Industry and trade' },
358-
{ id: 'other', name: 'Other' }
357+
{ id: 'other', name: 'Other' },
358+
{ id: 'industry-and-trade', name: 'Industry and trade' }
359359
],
360360
bundles: [
361361
{ id: 'mixed-project-aid', name: 'Mixed project aid' },

0 commit comments

Comments
 (0)