some d3 refactoring, now with various graphs