Created
March 30, 2020 13:11
-
-
Save darrenmothersele/a032f351eb99fcf9318f358a24c2b76d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title": "Coronavirus Dashboard", | |
"blocks": [ | |
{ | |
"type": "multi", | |
"batches": [ | |
{ | |
"blocks": [ | |
{ | |
"type": "init" | |
}, | |
{ | |
"type": "http", | |
"method": "get", | |
"endpoint": "https://covid19.mathdro.id/api" | |
}, | |
{ | |
"type": "mapping", | |
"mapping": "[{ label: 'Confirmed', value: data.confirmed.value},{ label: 'Recovered', value: data.recovered.value},{ label: 'Deaths', value: data.deaths.value}]" | |
}, | |
{ | |
"type": "batch", | |
"flex": true, | |
"blocks": [ | |
{ | |
"type": "card", | |
"blocks": [ | |
{ | |
"type": "message", | |
"title": "{{ value }}", | |
"message": "{{ label }}" | |
} | |
] | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"blocks": [ | |
{ | |
"type": "init" | |
}, | |
{ | |
"type": "http", | |
"method": "get", | |
"endpoint": "https://covid19.mathdro.id/api/daily" | |
}, | |
{ | |
"type": "multi", | |
"batches": [ | |
{ | |
"blocks": [ | |
{ | |
"type": "mapping", | |
"mapping": "{ data: data[*].{ value: confirmed.total, label: reportDate }, label: 'confirmed' }" | |
} | |
] | |
}, | |
{ | |
"blocks": [ | |
{ | |
"type": "mapping", | |
"mapping": "{ data: data[*].{ value: deaths.total, label: reportDate }, label: 'deaths' }" | |
} | |
] | |
} | |
] | |
}, | |
{ | |
"type": "chart", | |
"chartType": "line", | |
"multi": true | |
} | |
] | |
}, | |
{ | |
"blocks": [ | |
{ | |
"type": "init" | |
}, | |
{ | |
"type": "http", | |
"method": "get", | |
"endpoint": "https://covid19.mathdro.id/api/daily" | |
}, | |
{ | |
"type": "mapping", | |
"mapping": "[{ data: pairwise(data[-30:])[?next!=`null`].{ label: next.reportDate, value: percentChange(current.totalConfirmed, next.totalConfirmed) }, label: 'percentage change' }]" | |
}, | |
{ | |
"type": "chart", | |
"chartType": "line", | |
"multi": true | |
} | |
] | |
}, | |
{ | |
"blocks": [ | |
{ | |
"type": "init" | |
}, | |
{ | |
"type": "message", | |
"title": "COVID-19 Recoveries", | |
"message": "Locations with more than 20 recoveries" | |
}, | |
{ | |
"type": "http", | |
"method": "get", | |
"endpoint": "https://covid19.mathdro.id/api/recovered" | |
}, | |
{ | |
"type": "mapping", | |
"mapping": "data[?recovered > `20`].{ lat: lat, long: long, label: join(' ', [to_string(recovered), 'recovered in', combinedKey][? @ != null]) }" | |
}, | |
{ | |
"type": "map", | |
"height": 500, | |
"zoom": 2 | |
} | |
] | |
} | |
] | |
} | |
], | |
"id": "covidDashboard", | |
"adapterName": "kendraio" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment