WDP.displayViz = function(data){
	//height and width of svg
	var height = window.innerHeight;
	var width = window.innerWidth;
	var padding = 0;

	var viz = d3.select("#viz-wrapper")
					.append('svg')
					.attr('id', 'viz')
					.attr('height', height)
					.attr('width', width)
					.append('g');

	var rDomain = d3.extent(data, function(d){
        return d.amount;
    });
	var rScale = d3.scale.linear().domain(rDomain).range([1, 25]);

	var dots = viz.selectAll('g.dots').data(data).enter().append('g').attr('class', 'dots');
	dots.attr('transform', function(d){
		var x = Math.max(padding, Math.random() * width - padding);
		var y = Math.max(padding, Math.random() * height - padding);
		return "translate(" + x + ", " + y + ")";
	});

	dots.append('circle').attr('r', function(d){ return rScale(d.amount); });
	dots.append('text').text(function(d){return d.name;});

	/*
	//background rectangles are being created, but I cannot get them to show up for some reason
	viz.selectAll("text").each(function(d, i){
		var bbox = this.getBBox();
		console.log(bbox);
		var padding = 2;
		var rect = d3.select(document.createElement("rect"))
			.attr("x", bbox.x - padding)
		    .attr("y", bbox.y - padding)
		    .attr("width", bbox.width + (padding*2))
		    .attr("height", bbox.height + (padding*2))
		    .attr('class', 'word_label_background');
		this.parentNode.insertBefore(rect.node(), this.nextSibling);

	});
	*/
}






















@@ -1423,19 +1423,1128 @@
 %09*/%0A%7D%0A%0A%0A
-%0A%0A%0A
+WDP.displaySearchViz = function(requestData)%7B%0A%09$.ajax(%7B%0A%09%09url: WDP.baseUrl + 'data',%0A%09%09type: 'POST',%0A%09%09dataType: 'html',%0A%09%09data: requestData%0A%09%7D)%0A%0A%09.done(function(searchResults) %7B%0A%09%09if(searchResults.match(/%5EThis IP has been automatically blocked./i))%7B%0A%09%09%09WDP.displayError(%22Sorry, but it appears that Craigslist has blocked this site from collecting data.%22);%0A%09%09%09console.error(searchResults);%0A%09%09%09return;%0A%09%09%7D%0A%09%09var set = new WDP.countedSet();%0A%09%09$(searchResults).find('a.hdrlnk').each(function(index) %7B%0A%09%09%09var resultsLink = $(this);%0A%09%09%09var title = resultsLink.text();%0A%09%09%09title.split(%22 %22).map(function(word, index) %7B%0A%09%09%09%09set.add(word);%0A%09%09%09%7D);%0A%09%09%7D);%0A%09%09var main_list = $('#main_list');%0A%09%09var sortedCollection = set.getSortedCollection();%0A%09%09//remove previous viz%0A%09%09WDP.resetViz();%0A%09%09sortedCollection.map(function(elem) %7B%0A%09%09%09main_list.append(%22%3Cli%3E%22 + elem.name + ' ('+ elem.amount + %22)%3C/li%3E%22);%0A%09%09%7D);%0A%09%09WDP.displayViz(sortedCollection);%0A%09%7D)%0A%09.fail(function() %7B%0A%09%09WDP.displayError(%22Sorry, could not connect to Craigslist.%22);%0A%09%7D);%0A%7D%0A%0A%0AWDP.resetViz = function()%7B%0A    $('#viz-wrapper').html('');%0A    $('#main_list').html('');%0A%7D
 %0A%0A%0A%0A%0A%0A%0A%0A

move display search results function into dat_viz.js file