|
|
|
|
@ -9,6 +9,8 @@ let xScale, yScale;
|
|
|
|
|
let highlighted = []
|
|
|
|
|
let courses = []
|
|
|
|
|
let metros = []
|
|
|
|
|
let yAxis = 'dropped'
|
|
|
|
|
//let yAxis = 'outcomes'
|
|
|
|
|
|
|
|
|
|
const randomColor = ()=>{
|
|
|
|
|
const red = Math.floor(Math.random()*128) + 64;
|
|
|
|
|
@ -64,7 +66,13 @@ const renderPoints = () => {
|
|
|
|
|
.append('circle');
|
|
|
|
|
|
|
|
|
|
d3.selectAll('circle')
|
|
|
|
|
.attr('cy', (datum, index) => yScale(datum.ninety_day_outcomes/datum.graduates*100) )
|
|
|
|
|
.attr('cy', (datum, index) => {
|
|
|
|
|
if(yAxis === 'outcomes'){
|
|
|
|
|
return yScale(datum.ninety_day_outcomes/datum.graduates*100)
|
|
|
|
|
} else {
|
|
|
|
|
return yScale(datum.dropped/datum.total_students*100)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.attr('cx', (datum, index) => xScale(parseTime(datum.graduation_date)) )
|
|
|
|
|
.attr('fill', datum => datum.color? datum.color : 'black')
|
|
|
|
|
.attr('r', datum => datum.color? 10 : 5)
|
|
|
|
|
@ -113,7 +121,11 @@ const setupGraph = ()=>{
|
|
|
|
|
yScale = d3.scaleLinear();
|
|
|
|
|
yScale.range([HEIGHT, 0]);
|
|
|
|
|
const yDomain = d3.extent(instances, (datum, index) => {
|
|
|
|
|
if(yAxis === 'outcomes'){
|
|
|
|
|
return datum.ninety_day_outcomes/datum.graduates*100;
|
|
|
|
|
} else {
|
|
|
|
|
return datum.dropped/datum.total_students*100;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
yScale.domain(yDomain);
|
|
|
|
|
}
|
|
|
|
|
|