d3 as factory.