[ Launch: ] 11154514 by hartzis
[ Launch: Tributary inlet ] 10932495 by ekimed
-
-
Save hartzis/11154514 to your computer and use it in GitHub Desktop.
hove pie example -
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"description":"hove pie example - ","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},"main.js":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":true,"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/3gvMepr.gif"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 + ")"); | |
svg.selectAll(".title") | |
.data([sumPayments]) | |
.enter() | |
.append("text") | |
.attr({ x: 52, | |
y: 44}) | |
.text("Arvada Medicare Payments by Specialty"); | |
g.append("path") | |
.attr("fill", function(d){return colorScale(d.data.payments);}) | |
.attr("d", arc) | |
g | |
.append("text") | |
.attr("transform", function(d){ return "translate(" + arc.centroid(0) +")"; }) | |
.attr("text-anchor", "middle") | |
.text(function(d){ return d.data.specialty; }) | |
.attr('class', 'text-title'); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.text-title { | |
display: none; | |
font-size: 12px; | |
} | |
.title{ | |
margin 0 auto | |
height 50px | |
width 300px | |
font-size 40px | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".title").text("Aravada Medicare Payment by Specialty"); | |
$("g").on("hover", function(){ | |
$(this).find(".text-title").toggle(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment