viewof gene_of_interest = {
const element = html`
<div style="display: inline-block; user-select: none;"></div>`;
element.value = 'Click on a gene to obtain detailed information'
d3.select(element)
.selectAll('div')
.data(gene_list.map(x=>x + ', '))
.join('span')
.text(d => d)
.style('font-weight', '150')
.style('color', function(d){
let inst_gene = d.toLowerCase().replace(', ','')
let inst_color
if (common_genes.length > 0){
if (common_genes.includes(inst_gene)){
inst_color = 'blue'
} else {
inst_color = '#2F4F4F'
}
} else {
inst_color = 'black'
}
return inst_color
})
.on('click', function(d){
console.log('clicking gene in paragraph', this)
d3.select(element).selectAll('span')
.style('font-weight', '150')
d3.select(this)
.style('font-weight', 'bold')
element.value = d.replace(', ', '')
element.dispatchEvent(new CustomEvent("input"));
})
return element;
}