diff --git a/public/app.js b/public/app.js index 4276f18..2f69672 100644 --- a/public/app.js +++ b/public/app.js @@ -2,6 +2,7 @@ const WIDTH = 800; const HEIGHT = 600; let instances; +const selectedInstances = []; let xScale, yScale; const parseTime = d3.timeParse("%B %e, %Y"); const formatTime = d3.timeFormat("%B %e, %Y"); @@ -63,9 +64,23 @@ const createAxes = () => { .call(leftAxis); } +const createFormSubmissionHandler = () => { + d3.select('form').on('submit', (event)=>{ + event.preventDefault(); + const instanceID = parseInt(d3.select('input[type="text"]').property('value')) + selectedInstances.push(instanceID); + const list = d3.select('ul'); + list.html(''); + for(instance of selectedInstances){ + list.append('li').html(instance) + } + }); +} + window.onload = async ()=>{ instances = await d3.json('/instances'); setupGraph(); createAxes(); renderPoints(); + createFormSubmissionHandler(); } diff --git a/public/index.html b/public/index.html index e942a6c..c477458 100644 --- a/public/index.html +++ b/public/index.html @@ -10,16 +10,30 @@

Outcomes Tracker

See how instances did in comparisson to others

-
-
X-Axis:
-
Graduation Date
-
Y-Axis:
-
Percentage of graduates that got a job within 90 days of graduation.
-
- - - +
+

The Graph

+
+
X-Axis:
+
Graduation Date
+
Y-Axis:
+
Percentage of graduates that got a job within 90 days of graduation.
+
+ + + + - + +
+

Choose Instances To Highlight

+
+ + +
+
+
+

Highlighted Instances

+ +