PoonLab/covizu

Blank number of cases when hovering over a bead

Closed this issue · 1 comments

When hovering over a bead in the beadplot, the number of cases is blank

image

covizu/js/beadplot.js

Lines 502 to 505 in e444b88

if (!d.unsampled) {
tooltipText += region_to_string(tabulate(d.region));
tooltipText += `<b>${i18n_text.hedge_unique_dates}:</b> ${d.numBeads}<br/>`;
tooltipText += `<b>${i18n_text.hedge_coldates}:</b><br>${formatDate(d.x1)} / ${formatDate(d.x2)}`;

my_regions is empty:

covizu/js/beadplot.js

Lines 938 to 954 in e444b88

function region_to_string(my_regions) {
// Display region distribution in tooltip
let regStr = `<b>${i18n_text.tip_cases}:</b><br>`,
total = 0;
for (let [r_key, r_value] of Object.entries(my_regions)) {
regStr += `&nbsp;&nbsp;${i18n_text.region_legend[r_key]}: ${r_value}<br>`;
total += r_value;
}
// Display total number of cases if variants are from multiple countries
if(Object.keys(my_regions).length > 1) {
regStr += `${i18n_text.total}: ${total}<br>`
}
return regStr;
}