d3 written in cube module way, code is transfered from d3