fixed d3.legend not working in build