From ec8786539e1bba3125f8c018914800dd42e9021a Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Fri, 29 Sep 2023 10:06:15 -0400 Subject: [PATCH] display instances checkbox --- public/app.js | 8 +++++++- public/index.html | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/public/app.js b/public/app.js index 1d51799..8ba4440 100644 --- a/public/app.js +++ b/public/app.js @@ -15,6 +15,7 @@ let averageOutcomesArray let sortedInstances; let displayAverage = false; let displayStandardDeviation = false; +let displayInstances = true; const randomColor = ()=>{ const red = Math.floor(Math.random()*128) + 64; @@ -87,7 +88,7 @@ const renderPoints = () => { const metro = metros.find(m => m.metro === instanceMetro) const course = courses.find(c => c.course === instanceCourse) - if(metro.checked && course.checked){ + if(displayInstances && metro.checked && course.checked){ return 'block' } else { return 'none' @@ -373,6 +374,11 @@ const setUpDisplayAverageHandler = ()=>{ displayStandardDeviation = event.target.checked displayMeanStandardDeviation() }) + d3.select('#average input:nth-child(4)') + .on('click', (event)=>{ + displayInstances = event.target.checked + renderPoints() + }) } window.onload = async ()=>{ diff --git a/public/index.html b/public/index.html index 43da49c..53427e0 100644 --- a/public/index.html +++ b/public/index.html @@ -29,6 +29,8 @@ Display Average? Display Standard Deviation? + + Display Instances?

Choose Metros To Display