I am using this example to create a zoomable treemap. I have set the colors to d3.scale.category10().
function rect(rect) {
rect.attr("x", function(d) { return x(d.x); })
.attr("y", function(d) { return y(d.y); })
.attr("width", function(d) { return x(d.x + d.dx) - x(d.x); })
.attr("height", function(d) { return y(d.y + d.dy) - y(d.y); })
.style("background", function(d) { return d.parent ? color(d.name) : null; })
.attr("class", "treemapRect");
}
The above function is called every time a rect is selected. The line that sets the background is supposed to render each rect as a different color in the d3 category 10 scheme. It works perfectly fine in Chrome and Opera. In Firefox, however, the rects do not appear to have any color, despite having a value assigned in the inspector. A rect will show the following attributes in the inspector:
background-color: rgb(31, 119, 180);
background-image: none;
background-repeat: repeat;
background-attachment: scroll;
background-clip: border-box;
background-origin: padding-box;
background-position-x: 0%;
background-position-y: 0%;
background-size: auto auto;
For comparison, Chrome shows that a rect will have these attributes:
background-image: initial;
background-position-x: initial;
background-position-y: initial;
background-size: initial;
background-repeat-x: initial;
background-repeat-y: initial;
background-attachment: initial;
background-origin: initial;
background-clip: initial;
background-color: rgb(227, 229, 229);
Why is Firefox not displaying what is shown in the inspector?