Skip to content
This repository has been archived by the owner on Mar 15, 2023. It is now read-only.

Commit

Permalink
Merge branch 'nyp-cdw-tooltip_positioning'
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisknoll committed Oct 31, 2014
2 parents 1bed04a + 8506fec commit 65ae8d9
Show file tree
Hide file tree
Showing 9 changed files with 123 additions and 100 deletions.
10 changes: 7 additions & 3 deletions css/achilles.css
Original file line number Diff line number Diff line change
Expand Up @@ -291,19 +291,19 @@ div.personSummary .row div {

.pathleaf {
font-size: 14px;
color: #fff;
color: #333;
font-weight: bold;
margin-bottom: 3px;
}
.pathleafstat {
font-size: 12px;
color: #ddd;
color: #666;
font-family: "Courier New";
margin-bottom: 2px;
}
.pathstep {
font-size: 12px;
color: #aaa;
color: #333;
margin-bottom: 1px;
}
hr.path {
Expand Down Expand Up @@ -388,3 +388,7 @@ table.dataTable tbody tr.odd.selected {
.sorting_3 {
background-color: rgba(89, 159, 216, 0.1) !important;
}
.popover {
max-width: 800px;
z-index: 1040;
}
27 changes: 15 additions & 12 deletions js/app/reports/condition_era.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,23 +242,26 @@
getcolorvalue: function (node) {
return node.length_of_era;
},
getcontent: function (node) {
var result = '',
steps = node.path.split('||'),
i = steps.length - 1;
result += '<div class="pathleaf">' + steps[i] + '</div>';
result += '<div class="pathleafstat">Prevalence: ' + format_pct(node.pct_persons) + '</div>';
result += '<div class="pathleafstat">Number of People: ' + format_comma(node.num_persons) + '</div>';
result += '<div class="pathleafstat">Length of Era: ' + format_fixed(node.length_of_era) + '</div>';
return result;
},
gettitle: function (node) {
title = '';
steps = node.path.split('||');
for (i = 0; i < steps.length; i++) {
if (i == steps.length - 1) {
title += '<hr class="path">';
title += '<div class="pathleaf">' + steps[i] + '</div>';
title += '<div class="pathleafstat">Prevalence: ' + format_pct(node.pct_persons) + '</div>';
title += '<div class="pathleafstat">Number of People: ' + format_comma(node.num_persons) + '</div>';
title += '<div class="pathleafstat">Length of Era: ' + node.length_of_era + '</div>';
} else {
title += ' <div class="pathstep">' + Array(i + 1).join('&nbsp;&nbsp') + steps[i] + ' </div>';
}
var title = '',
steps = node.path.split('||');
for (i = 0; i < steps.length - 1; i++) {
title += ' <div class="pathstep">' + Array(i + 1).join('&nbsp;&nbsp') + steps[i] + ' </div>';
}
return title;
}
});
$('[data-toggle="popover"]').popover();
}

});
Expand Down
27 changes: 15 additions & 12 deletions js/app/reports/condition_occurrence.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,23 +244,26 @@
getcolorvalue: function (node) {
return node.records_per_person;
},
getcontent: function (node) {
var result = '',
steps = node.path.split('||'),
i = steps.length - 1;
result += '<div class="pathleaf">' + steps[i] + '</div>';
result += '<div class="pathleafstat">Prevalence: ' + format_pct(node.pct_persons) + '</div>';
result += '<div class="pathleafstat">Number of People: ' + format_comma(node.num_persons) + '</div>';
result += '<div class="pathleafstat">Records per Person: ' + format_fixed(node.records_per_person) + '</div>';
return result;
},
gettitle: function (node) {
title = '';
steps = node.path.split('||');
for (i = 0; i < steps.length; i++) {
if (i == steps.length - 1) {
title += '<hr class="path">';
title += '<div class="pathleaf">' + steps[i] + '</div>';
title += '<div class="pathleafstat">Prevalence: ' + format_pct(node.pct_persons) + '</div>';
title += '<div class="pathleafstat">Number of People: ' + format_comma(node.num_persons) + '</div>';
title += '<div class="pathleafstat">Records per Person: ' + format_fixed(node.records_per_person) + '</div>';
} else {
title += ' <div class="pathstep">' + Array(i + 1).join('&nbsp;&nbsp') + steps[i] + ' </div>';
}
var title = '',
steps = node.path.split('||');
for (i = 0; i < steps.length - 1; i++) {
title += ' <div class="pathstep">' + Array(i + 1).join('&nbsp;&nbsp') + steps[i] + ' </div>';
}
return title;
}
});
$('[data-toggle="popover"]').popover();
}

});
Expand Down
27 changes: 15 additions & 12 deletions js/app/reports/drug_era.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,23 +240,26 @@
getcolorvalue: function (node) {
return node.length_of_era;
},
getcontent: function (node) {
var result = '',
steps = node.path.split('||'),
i = steps.length - 1;
result += '<div class="pathleaf">' + steps[i] + '</div>';
result += '<div class="pathleafstat">Prevalence: ' + format_pct(node.pct_persons) + '</div>';
result += '<div class="pathleafstat">Number of People: ' + format_comma(node.num_persons) + '</div>';
result += '<div class="pathleafstat">Length of Era: ' + format_fixed(node.length_of_era) + '</div>';
return result;
},
gettitle: function (node) {
title = '';
steps = node.path.split('||');
for (i = 0; i < steps.length; i++) {
if (i == steps.length - 1) {
title += '<hr class="path">';
title += '<div class="pathleaf">' + steps[i] + '</div>';
title += '<div class="pathleafstat">Prevalence: ' + format_pct(node.pct_persons) + '</div>';
title += '<div class="pathleafstat">Number of People: ' + format_comma(node.num_persons) + '</div>';
title += '<div class="pathleafstat">Length of Era: ' + format_fixed(node.length_of_era) + '</div>';
} else {
title += ' <div class="pathstep">' + Array(i + 1).join('&nbsp;&nbsp') + steps[i] + ' </div>';
}
var title = '',
steps = node.path.split('||');
for (i = 0; i < steps.length - 1; i++) {
title += ' <div class="pathstep">' + Array(i + 1).join('&nbsp;&nbsp') + steps[i] + ' </div>';
}
return title;
}
});
$('[data-toggle="popover"]').popover();
}

});
Expand Down
27 changes: 15 additions & 12 deletions js/app/reports/drug_exposure.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,23 +256,26 @@
getcolorvalue: function (node) {
return node.records_per_person;
},
getcontent: function (node) {
var result = '',
steps = node.path.split('||'),
i = steps.length - 1;
result += '<div class="pathleaf">' + steps[i] + '</div>';
result += '<div class="pathleafstat">Prevalence: ' + format_pct(node.pct_persons) + '</div>';
result += '<div class="pathleafstat">Number of People: ' + format_comma(node.num_persons) + '</div>';
result += '<div class="pathleafstat">Records per Person: ' + format_fixed(node.records_per_person) + '</div>';
return result;
},
gettitle: function (node) {
title = '';
steps = node.path.split('||');
for (i = 0; i < steps.length; i++) {
if (i == steps.length - 1) {
title += '<hr class="path">';
title += '<div class="pathleaf">' + steps[i] + '</div>';
title += '<div class="pathleafstat">Prevalence: ' + format_pct(node.pct_persons) + '</div>';
title += '<div class="pathleafstat">Number of People: ' + format_comma(node.num_persons) + '</div>';
title += '<div class="pathleafstat">Records per Person: ' + format_fixed(node.records_per_person) + '</div>';
} else {
title += ' <div class="pathstep">' + Array(i + 1).join('&nbsp;&nbsp') + steps[i] + ' </div>';
}
var title = '',
steps = node.path.split('||');
for (i = 0; i < steps.length - 1; i++) {
title += ' <div class="pathstep">' + Array(i + 1).join('&nbsp;&nbsp') + steps[i] + ' </div>';
}
return title;
}
});
$('[data-toggle="popover"]').popover();
}

});
Expand Down
27 changes: 15 additions & 12 deletions js/app/reports/observation.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,23 +413,26 @@
getcolorvalue: function (node) {
return node.records_per_person;
},
getcontent: function (node) {
var result = '',
steps = node.path.split('||'),
i = steps.length - 1;
result += '<div class="pathleaf">' + steps[i] + '</div>';
result += '<div class="pathleafstat">Prevalence: ' + format_pct(node.pct_persons) + '</div>';
result += '<div class="pathleafstat">Number of People: ' + format_comma(node.num_persons) + '</div>';
result += '<div class="pathleafstat">Records per Person: ' + format_fixed(node.records_per_person) + '</div>';
return result;
},
gettitle: function (node) {
title = '';
steps = node.path.split('||');
for (i = 0; i < steps.length; i++) {
if (i == steps.length - 1) {
title += '<hr class="path">';
title += '<div class="pathleaf">' + steps[i] + '</div>';
title += '<div class="pathleafstat">Prevalence: ' + format_pct(node.pct_persons) + '</div>';
title += '<div class="pathleafstat">Number of People: ' + format_comma(node.num_persons) + '</div>';
title += '<div class="pathleafstat">Records per Person: ' + format_fixed(node.records_per_person) + '</div>';
} else {
title += ' <div class="pathstep">' + Array(i + 1).join('&nbsp;&nbsp') + steps[i] + ' </div>';
}
var title = '',
steps = node.path.split('||');
for (i = 0; i < steps.length - 1; i++) {
title += ' <div class="pathstep">' + Array(i + 1).join('&nbsp;&nbsp') + steps[i] + ' </div>';
}
return title;
}
});
$('[data-toggle="popover"]').popover();
}

});
Expand Down
27 changes: 15 additions & 12 deletions js/app/reports/procedure_occurrence.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,23 +238,26 @@
getcolorvalue: function (node) {
return node.records_per_person;
},
getcontent: function (node) {
var result = '',
steps = node.path.split('||'),
i = steps.length - 1;
result += '<div class="pathleaf">' + steps[i] + '</div>';
result += '<div class="pathleafstat">Prevalence: ' + format_pct(node.pct_persons) + '</div>';
result += '<div class="pathleafstat">Number of People: ' + format_comma(node.num_persons) + '</div>';
result += '<div class="pathleafstat">Records per Person: ' + format_fixed(node.records_per_person) + '</div>';
return result;
},
gettitle: function (node) {
title = '';
steps = node.path.split('||');
for (i = 0; i < steps.length; i++) {
if (i == steps.length - 1) {
title += '<hr class="path">';
title += '<div class="pathleaf">' + steps[i] + '</div>';
title += '<div class="pathleafstat">Prevalence: ' + format_pct(node.pct_persons) + '</div>';
title += '<div class="pathleafstat">Number of People: ' + format_comma(node.num_persons) + '</div>';
title += '<div class="pathleafstat">Records per Person: ' + format_fixed(node.records_per_person) + '</div>';
} else {
title += ' <div class="pathstep">' + Array(i + 1).join('&nbsp;&nbsp') + steps[i] + ' </div>';
}
var title = '',
steps = node.path.split('||');
for (i = 0; i < steps.length - 1; i++) {
title += ' <div class="pathstep">' + Array(i + 1).join('&nbsp;&nbsp') + steps[i] + ' </div>';
}
return title;
}
});
$('[data-toggle="popover"]').popover();
}

});
Expand Down
27 changes: 15 additions & 12 deletions js/app/reports/visit_occurrence.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,23 +237,26 @@
getcolorvalue: function (node) {
return node.records_per_person;
},
getcontent: function (node) {
var result = '',
steps = node.path.split('||'),
i = steps.length - 1;
result += '<div class="pathleaf">' + steps[i] + '</div>';
result += '<div class="pathleafstat">Prevalence: ' + format_pct(node.pct_persons) + '</div>';
result += '<div class="pathleafstat">Number of People: ' + format_comma(node.num_persons) + '</div>';
result += '<div class="pathleafstat">Records per Person: ' + format_fixed(node.records_per_person) + '</div>';
return result;
},
gettitle: function (node) {
title = '';
steps = node.path.split('||');
for (i = 0; i < steps.length; i++) {
if (i == steps.length - 1) {
title += '<hr class="path">';
title += '<div class="pathleaf">' + steps[i] + '</div>';
title += '<div class="pathleafstat">Prevalence: ' + format_pct(node.pct_persons) + '</div>';
title += '<div class="pathleafstat">Number of People: ' + format_comma(node.num_persons) + '</div>';
title += '<div class="pathleafstat">Records per Person: ' + format_fixed(node.records_per_person) + '</div>';
} else {
title += ' <div class="pathstep">' + Array(i + 1).join('&nbsp;&nbsp') + steps[i] + ' </div>';
}
var title = '',
steps = node.path.split('||');
for (i = 0; i < steps.length - 1; i++) {
title += ' <div class="pathstep">' + Array(i + 1).join('&nbsp;&nbsp') + steps[i] + ' </div>';
}
return title;
}
});
$('[data-toggle="popover"]').popover();
}

});
Expand Down
24 changes: 11 additions & 13 deletions js/modules/d3/jnj.chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -1659,14 +1659,6 @@
.domain([color_range[0], color_range[1]])
.range(["#E4FF7A", "#FC7F00"]);

var tip = d3.tip()
.attr('class', 'd3-tip')
.offset([-10, 0])
.html(function (d) {
return options.gettitle(d);
})
svg.call(tip);

var cell = svg.selectAll("g")
.data(nodes)
.enter().append("svg:g")
Expand All @@ -1682,17 +1674,23 @@
.attr("height", function (d) {
return Math.max(0, d.dy - 1);
})
.attr("title", function (d) {
return options.gettitle(d);
})
.attr("id", function (d) {
return d.id;
})
.style("fill", function (d) {
return color(options.getcolorvalue(d));
})
.on('mouseover', tip.show)
.on('mouseout', tip.hide)
.attr("data-container", "body")
.attr("data-toggle", "popover")
.attr("data-trigger", "hover")
.attr("data-placement", "top")
.attr("data-html", true)
.attr("data-title", function (d) {
return options.gettitle(d);
})
.attr("data-content", function (d) {
return options.getcontent(d);
})
.on('click', function (d) {
if (d3.event.altKey) {
zoom(root);
Expand Down

0 comments on commit 65ae8d9

Please sign in to comment.