Skip to content
This repository has been archived by the owner on Nov 22, 2018. It is now read-only.

Commit

Permalink
updated demo pyramid to handle changes to x axis titles.
Browse files Browse the repository at this point in the history
  • Loading branch information
sdiemert committed Aug 11, 2015
1 parent c3b93f8 commit a71160f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions visualizations/BarVis.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@

function vis(data) {

console.log(data);

var dataCopy = (JSON.parse(JSON.stringify(data)));

//use only last point
Expand Down
14 changes: 8 additions & 6 deletions visualizations/DemographicsPyramidVis.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
var tempData;


function showVis(tempData, elemId, title) {
function showVis(tempData, elemId, title, xAxisName) {

tempData.totalPatients = reduceTempData();

Expand Down Expand Up @@ -276,7 +276,7 @@
.attr("x", width / 4)
.attr("y", margin.bottom)
.style({"text-anchor": "middle", "text-decoration": "none", "font-size": "14pt"})
.text(|| "Number of Patients");
.text(xAxisName || "Number of Patients");

//left side (male) x axis def
var x2Axis = d3.svg.axis()
Expand All @@ -294,7 +294,7 @@
.attr("x", width / 4)
.attr("y", margin.bottom)
.style({"text-anchor": "middle", "text-decoration": "none", "font-size": "14pt"})
.text("Number of Patients");
.text(xAxisName || "Number of Patients");

//add vertical lines to boarder y Axis on both sides
//
Expand Down Expand Up @@ -375,15 +375,17 @@
data.group = data.processed_result.group.slice(-1);
data.network = data.processed_result.network.slice(-1);

console.log(data);

//The age ranges for the y axis
//cannot be programtically determined thus hardcoded and
//subject to change if HubAPI changes served info

//putting network info into tempdata, once this is working @TODO turn eveything below
//into some sort of function and run for all three datasets
showVis(data.clinician[0], "#c1", "Clinician");
showVis(data.group[0], "#c2", "Group");
showVis(data.network[0], "#c3", "Network");
showVis(data.clinician[0], "#c1", "Clinician", data.xAxisTitle);
showVis(data.group[0], "#c2", "Group", data.xAxisTitle);
showVis(data.network[0], "#c3", "Network", data.xAxisTitle);
}

</script>

0 comments on commit a71160f

Please sign in to comment.