.. image:: https://travis-ci.org/jiankaiwang/ckanext-cdccushomepage.svg?branch=master
:target: https://travis-ci.org/jiankaiwang/ckanext-cdccushomepage
=============
ckanext-cdccushomepage
The ckanext implements the interactive charts for public health data on the homepage. There are seven charts shown, including Dengue NS1 Rapid Screening, Yearly Dengue Cases, Monthly Dengue Cases, Entrovirus Specimen, Diarrhea Outpatients, Out-patient Clinicis for Influenza, and Percentage of HIV Age Group.
.. image:: image/homepage.png
Requirements
- Developed on CKAN 2.5.x
- ckanext-cdcmainlib : https://github.com/jiankaiwang/ckanext-cdcmainlib
Preparation
Open the fanstatic/general.js, and edit the api link, for example::
dengueYearCountData(‘https://od.cdc.gov.tw/opendataplatform/?s=dengue&v=a1’);
diarrheaPieData(‘https://od.cdc.gov.tw/opendataplatform/?s=diarrheapiechart&v=a1’);
influLCBody(“https://od.cdc.gov.tw/opendataplatform/?s=influlinechart&v=a1”);
dengueLineChartBody(‘https://od.cdc.gov.tw/opendataplatform/?s=dengue&v=a2’);
entrovirusLBCBody(‘https://od.cdc.gov.tw/opendataplatform/?s=enterovirus&v=a1’);
hivBCDraw(‘https://od.cdc.gov.tw/opendataplatform/?s=hivbc&v=a1’);
Edit the fanstatic/combine.sh, and export the combined javascript (combined.js).
While you edit the single javascript, it is necessary to combine all the script into one
because ckan might import scripts in the wrong order.
For example::
Notice the sequential script in variable catJS.
vim ckanext/cdccushomepage/fanstatic/combine.sh
sh ckanext/cdccushomepage/fanstatic/combine.sh
Open ckanext/cdccushomepage/templates/home/snippets/denguens1.html, edit the iframe src, for example::
<iframe class=”iframe-container-ns1” src=”http://localhost:12080/dataset/denguens1map/resource/b7b93f4d-35f7-4630-94c8-6efcb9aa62e3/view/4943d2ee-e24b-47b7-b9e5-4e6b72a01e