Skip to content

Instantly share code, notes, and snippets.

@marks
Last active April 21, 2016 14:31
Show Gist options
  • Select an option

  • Save marks/fbc0ec84881140a9456c78fe4f843bb0 to your computer and use it in GitHub Desktop.

Select an option

Save marks/fbc0ec84881140a9456c78fe4f843bb0 to your computer and use it in GitHub Desktop.
VizWit: Sample of Combined NNDSS Table II Data (2016) - http://marks.github.io/vizwit/?gist=fbc0ec84881140a9456c78fe4f843bb0
{
"version": "2",
"header": {
"title": "Sample of Combined NNDSS Table II Data (2016)",
"description": "<strong style='font-size:16px;'><a href='https://data.cdc.gov/'>Data from multiple data.cdc.gov datasets</a> </strong> | This page by [email protected] <br><br>In these tables, all conditions with a 5-year average annual national total of more than or equals 1,000 cases but less than or equals 10,000 cases will be displayed (≥ 1,000 and ≤ 10,000). The Table includes total number of cases reported in the United States, by region and by states, in accordance with the current method of displaying MMWR data. Data on United States exclude counts from US territories.",
"navigation": [
{
"url": "https://cdc-science.demo.socrata.com/dataset/Sample-of-Combined-NNDSS-datasets/nmaj-nshg",
"label": "Full dataset"
},
{
"url": "https://gist.github.com/marks/fbc0ec84881140a9456c78fe4f843bb0",
"label": "Viz config"
}
]
},
"cards": [
{
"width": 4,
"height": 1,
"vizwit": {
"title": "Weeks Reporting",
"description": "Number of MMWR weeks of data reported in the base dataset and available for interactive querying on this page (This number does not cross-filter)",
"chartType": "callout",
"provider": "socrata",
"domain": "cdc-science.demo.socrata.com",
"dataset": "vcj3-5agi",
"valueField": "max(mmwr_week)",
"valueFormat": "0,0",
"channel": null,
"baseFilters": [
{
"field": "reporting_area",
"expression": {
"type": "=",
"value": "UNITED STATES"
}
}
]
}
},
{
"width": 4,
"height": 1,
"vizwit": {
"title": "Diseases Reporting",
"description": "Number of diseases of data reported in the base dataset and available for interactive querying on this page (This number does not cross-filter)",
"chartType": "callout",
"provider": "socrata",
"domain": "cdc-science.demo.socrata.com",
"dataset": "vcj3-5agi",
"valueField": "count(disease)",
"valueFormat": "0,0",
"channel": null,
"baseFilters": [
{
"field": "reporting_area",
"expression": {
"type": "=",
"value": "UNITED STATES"
}
},
{
"field": "mmwr_week",
"expression": {
"type": "=",
"value": "1"
}
}
]
}
},
{
"width": 4,
"height": 1,
"vizwit": {
"title": "Total Cases (YTD)",
"description": "Calculated by summing 'current_week' for all rows where 'reporting_area' is a state or DC",
"chartType": "callout",
"provider": "socrata",
"domain": "cdc-science.demo.socrata.com",
"dataset": "vcj3-5agi",
"aggregateFunction": "sum",
"aggregateField": "current_week",
"valueFormat": "0,0"
}
},
{
"width": 12,
"height": 5,
"vizwit": {
"title": "Total Cases by Week",
"description": "Calculated by grouing by 'mmwr_week' and summing 'current_week' for all rows where 'reporting_area' is a state or DC",
"chartType": "bar",
"provider": "socrata",
"domain": "cdc-science.demo.socrata.com",
"dataset": "vcj3-5agi",
"groupBy": "mmwr_week",
"aggregateFunction": "sum",
"aggregateField": "current_week",
"order": "label asc"
}
},
{
"width": 7,
"height": 8,
"vizwit": {
"title": "Cases by State",
"description": "Calculated by grouping by 'reporting_area' and summing 'current_week' for all rows where 'reporting_area' is a state or DC",
"chartType": "choropleth",
"provider": "socrata",
"domain": "cdc-science.demo.socrata.com",
"dataset": "vcj3-5agi",
"groupBy": "state_code",
"aggregateFunction": "sum",
"aggregateField": "current_week",
"boundaries": "https://cdn.rawgit.com/marks/2ec0287bfbf8e6d55b76/raw/d77f4c490147e0739745dca9735c37cdd6732d65/states.geojson",
"boundariesLabel": "name",
"boundariesId": "postal"
}
},
{
"width": 5,
"height": 8,
"vizwit": {
"title": "Cases by Region",
"description": "Calculated by grouping by 'reporting_area' and summing 'current_week' for all rows where 'reporting_area' is a region",
"chartType": "pie",
"provider": "socrata",
"domain": "cdc-science.demo.socrata.com",
"dataset": "vcj3-5agi",
"groupBy": "reporting_area",
"aggregateFunction": "sum",
"aggregateField": "current_week",
"order": "value desc",
"baseFilters": [
{
"field": "reporting_area",
"expression": {
"type": "in",
"value": [
"NEW ENGLAND",
"MID. ATLANTIC",
"E.N. CENTRAL",
"E.S. CENTRAL",
"S. ATLANTIC",
"W.N. CENTRAL",
"W.S. CENTRAL",
"MOUNTAIN",
"PACIFIC"
]
}
}
]
}
},
{
"width": 12,
"height": 8,
"vizwit": {
"title": "Total Cases by Disease",
"description": "Calculated by grouping by 'disease' and summing 'current_week' for all rows where 'reporting_area' is a state or DC",
"chartType": "bar",
"provider": "socrata",
"domain": "cdc-science.demo.socrata.com",
"dataset": "vcj3-5agi",
"groupBy": "disease",
"aggregateFunction": "sum",
"aggregateField": "current_week"
}
},
{
"x": 0,
"y": 19,
"width": 12,
"height": 8,
"vizwit": {
"chartType": "table",
"title": "Data Table",
"provider": "socrata",
"domain": "cdc-science.demo.socrata.com",
"dataset": "vcj3-5agi"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment