move color setting out of d3 to CSS and reformatting codes.