Adding some useful mini functions for d3 projects