preliminary d3 visualization refactored into methods