Dear programmers,
To customize the cspro-d3-chart which part of the application is update ?
In this folder there are many files associated with cspro data visualization.
Under the "report" folder there are html files and Java scripts codes so which one is editable to run based on the kind of data dictionary and report files?
Thanks in advance
Cspro-D3-chart
-
- Posts: 1801
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: Cspro-D3-chart
You can study Josh's example here:
https://github.com/jhandley/cspro-D3-charts
Here is the logic:
https://github.com/jhandley/cspro-D3-ch ... ts.ent.apc
Look, for example, at the countsVsExpectedReport function. He is writing out a JavaScript file with the input for the D3 chart.
https://github.com/jhandley/cspro-D3-charts
Here is the logic:
https://github.com/jhandley/cspro-D3-ch ... ts.ent.apc
Look, for example, at the countsVsExpectedReport function. He is writing out a JavaScript file with the input for the D3 chart.
string reportDataFilename = maketext("%scounts-vs-expected-data.js", reportDataDirectory);
setfile(tempFile, reportDataFilename);
filewrite(tempFile, "var data = [");
do i = 1 while i <= maxEa
if householdsByEa(i) > 0 then
EC_EA = i;
if loadcase(EXPECTEDCOUNTS_DICT, EC_EA) then
filewrite(tempFile, " {EA: '%03d', households: %d, expected: %d},",
i, householdsByEa(i), EC_HOUSEHOLDS);
endif;
endif;
enddo;
filewrite(tempFile, "];");
close(tempFile);
setfile(tempFile, reportDataFilename);
filewrite(tempFile, "var data = [");
do i = 1 while i <= maxEa
if householdsByEa(i) > 0 then
EC_EA = i;
if loadcase(EXPECTEDCOUNTS_DICT, EC_EA) then
filewrite(tempFile, " {EA: '%03d', households: %d, expected: %d},",
i, householdsByEa(i), EC_HOUSEHOLDS);
endif;
endif;
enddo;
filewrite(tempFile, "];");
close(tempFile);