{
const svg = d3.select(DOM.svg(500, 500));
const rect_back = svg.selectAll('g back')
.data(revise_data)
.enter()
.append('g')
.classed('back', true)
.attr("transform", "translate(100,10)");
rect_back.append('rect')
.attr("fill", "red")
.attr("stroke", "black")
.attr("x", (d,i)=>{return 0})
.attr("y", (d,i)=>{return i*120})
.attr("width", 500)
.attr("height", 100);
const react_back_genes = rect_back.selectAll('g genes')
.data(function(d,i){
var temp = [...d.genes.keys()].map((item)=> [d.genes[item],i]);
console.log(temp);
return temp
})
.enter()
.append('g')
.classed('genes', true)
.append('rect')
.attr("fill", "grey")
.attr("stroke", "black")
.attr("x", (d,i)=> i*100 )
.attr("y", (d,i)=> d[1]*120 )
.attr("width", 100)
.attr("height", 100);
svg.selectAll('text.upper')
.data(revise_data)
.enter()
.append('text')
.text((d,i)=> "Pathway "+ i)
.attr("x", (d,i)=> 0)
.attr("y", (d,i)=> 30+i*120 )
.attr("font-family", "sans-serif")
.attr("font-size", "20px")
.attr("fill", "black")
.classed('upper', true);
const gene_text = rect_back.selectAll('g.genename')
.data((d,i)=> [...d.genes.keys()].map((item)=> [d.genes[item],i]))
.enter()
.append('g')
.classed('genename',true)
.append('text')
.text((d,i)=> {
console.log(d);
return d[0].gene
} )
.attr("x", (d,i)=> 30+i*120 )
.attr("y", (d,i)=> 30+d[1]*120 )
.attr("font-family", "sans-serif")
.attr("font-size", "20px")
.attr("fill", "black")
.classed('genename', true);
console.log(gene_text);
return svg.node()
}