barcode3 = {
const svg = d3
.create("svg")
.attr("viewBox", [0, 0, width, height])
.style("overflow", "visible");
let o2 = d3
.scaleLinear()
.domain(d3.extent(data, (d) => d.price))
.range([0.4, 1]);
let c2 = d3
.scaleOrdinal()
.domain(room)
.range(["#f20666", "#06d6a0", "#662e9b", "#9EF211"]);
svg
.selectAll("rect")
.data(data)
.join("rect")
.attr("x", (d) => x(d.price))
.attr("y", (d) => y(d.room_type))
.attr("width", 1)
.attr("height", y.bandwidth())
.attr("fill", (d) => c2(d.room_type))
.attr("opacity", (d) => o2(d.price));
return svg.node();
}