Skip to content

Instantly share code, notes, and snippets.

@MasterAM MasterAM/_.md
Created Apr 20, 2014

Embed
What would you like to do?
Tributary inlet
specialty payments
Internal Medicine 195128.97999999998
Optometry 47320.29
Interventional Pain Management 75131.96
Clinical Psychologist 8566.87
Occupational therapist 16264.46
Physical Therapist 155039.89999999997
Mass Immunization Roster Biller 27733.28
Emergency Medicine 13628.17
Family Practice 207513.41
Nephrology 332823.44
Ophthalmology 170976.02
Otolaryngology 77590.5
Nurse Practitioner 19071.27
Chiropractic 12909.73
Pathology 13280.58
General Practice 252393.31
Obstetrics/Gynecology 3574.4800000000005
Physician Assistant 13308.41
{"description":"Tributary inlet","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"arvadaPayments.csv":{"default":true,"vim":false,"emacs":false,"fontSize":12},"main.css":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"pingpong","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"ajax-caching":true,"thumbnail":"http://i.imgur.com/BDq3SD5.png"}
var arvadaData = tributary.arvadaPayments
var sumPayments = d3.sum(arvadaData, function(d) {return +d.payments;});
var svg = d3.select("svg");
var width = 527,
height = 562,
radius = Math.min(width, height) / 2;
var outerRadius = width/2;
var colorScale = d3.scale.category20(); //built in range of 20 colors
var arc = d3.svg.arc() //creates <path> elements using arc data
.outerRadius(width / 2)
.innerRadius(100);
var pie = d3.layout.pie()
.sort(null)
.value(function(d){ return +d.payments });
var g = svg.selectAll("g.arc")
.data(pie(arvadaData))
.enter()
.append("g")
.attr("class", "arc")
.attr("transform", "translate(" + width/2 + "," + height/2 + ")");
g.append("path")
.attr("fill", function(d, i){return colorScale(i);})
.attr("d", arc);
g.append("text")
.attr("transform", function(d){ return "translate(" + arc.centroid(d) +")"; })
.attr("text-anchor", "middle")
.text(function(d){ return d[i].payments; });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.