scaleBandColor = {
const svg = d3.create("svg").attr("width", 580).attr("height", 100).style("background-color", "lightblue")
let colors = ["red", "orange", "green", "blue"];
let xScale = d3.scaleBand()
.domain(colors)
.range([25, 555])
.paddingInner([.5]);
let xAxis = d3.axisBottom(xScale)
svg.append("g")
.attr("transform", "translate(0, 70)")
.call(xAxis);
svg.selectAll("rect")
.data(colors)
.join("rect")
.attr("x", d => xScale(d))
.attr("y", 40)
.attr("width", d => xScale.bandwidth())
.attr("height", 30)
.attr("fill", d => d)
return svg.node()
}