functionality to switch y-axis

average
Matthew Huntington 2 years ago
parent a80783f559
commit 8c84adc171

@ -227,6 +227,19 @@ const populateMetrosCoursesCheckboxes = ()=>{
}) })
} }
const createRadioButtonHanlders = ()=>{
d3.selectAll('input[type="radio"]')
.on('click', (event)=>{
yAxis = event.target.value
d3.select('#y-axis').remove()
d3.select('#x-axis').remove()
d3.selectAll('#points circle').remove();
setupGraph()
createAxes()
renderPoints()
})
}
window.onload = async ()=>{ window.onload = async ()=>{
instances = await d3.json('/instances'); instances = await d3.json('/instances');
for(let instance of instances){ for(let instance of instances){
@ -246,4 +259,5 @@ window.onload = async ()=>{
createAxes(); createAxes();
renderPoints(); renderPoints();
createFormSubmissionHandler(); createFormSubmissionHandler();
createRadioButtonHanlders();
} }

Loading…
Cancel
Save