//- UNCLASSIFIED

extends base
append base_parms
	- tech = "d3"

append base_help
	:markdown
		 Produce d3 doodle interface.

append base_head

	style.
		body {
			background: #222;
		}
		circle {
		fill: none;
			stroke-width: 1.5px;
		}

	script.
		var opts = {
		};

append base_body

	script(src="/clients/d3/d3.v3.min.js")
	script.
		var 
			w = opts.w|| 960,
			h = opts.h || 500,
			z = d3.scale.category20c(),
			i = 0;

		var svg = d3.select("#content").append("svg:svg")
			.attr("width", w)
			.attr("height", h)
			.style("pointer-events", "all")
			.on("mousemove", particle);

		function particle() {
			var m = d3.mouse(this);

			svg.append("svg:circle")
				.attr("cx", m[0])
				.attr("cy", m[1])
				.attr("r", 1e-6)
				.style("stroke", z(++i))
				.style("stroke-opacity", 1)
				.transition()
				.duration(2000)
				.ease(Math.sqrt)
				.attr("r", 100)
				.style("stroke-opacity", 1e-6)
				.remove();
		}
		
// UNCLASSIFIED
		
