largeMealChart2 = {
const svg = d3
.create("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", glucoseBoxPlotHeight + margin.top + margin.bottom)
.attr("id", "scoreFrame ");
const container = svg
.append("g")
.attr("transform", `translate(${margin.left * 3}, 180)`)
.attr("class", "cell score-large");
let bars = container
.selectAll(".score-column")
.data(scoreGroupedFood)
.enter()
.append("rect")
.attr("width", 8)
.attr("rx", 2)
.attr("id", "scoreBar")
.attr("height", (d) => {
return scoreBarYScale(d.total);
})
.attr("transform", (d, i) => {
return `translate(${16 * i}, ${
scoreBarYScale.range()[1] - scoreBarYScale(d.total)
})`;
})
.style("fill", (d) => {
return zoneColor(d.score);
});
let barLabels = container
.selectAll(".score-bar-label")
.data(scoreGroupedFood)
.enter()
.append("text")
.attr("id", "scoreBarLabel")
.attr("transform", (d, i) => {
return `translate(${16 * i + 4}, ${scoreBarYScale.range()[1] + 15})`;
})
.style("fill", (d) => {
return zoneColor(d.score);
})
.text((d) => {
return d.score;
})
.style("font-size", "11")
.style("text-anchor", "middle")
.style("font-family", "sans-serif");
let circles = container
.selectAll(".score-circle")
.data(scoreGroupedFood)
.enter()
.append("circle")
.attr("id", "scoreCircle")
.attr("r", (d) => {
return scoreCircleScale(d.total);
})
.attr("transform", (d, i) => {
return `translate(${32 * i + 300}, -60)`;
})
.style("fill", (d) => {
return zoneColor(d.score);
});
return svg.node();
}