-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added graphs for individual events #41
base: master
Are you sure you want to change the base?
Conversation
I just pushed the changes from today. Let me know if anything needs to be changed! |
</div> | ||
|
||
<Event /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't commit this
src/components/ControlPanel/event.js
Outdated
@@ -0,0 +1,58 @@ | |||
//Edited from components/Events/UserEvents/event.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove these comments
src/components/ControlPanel/event.js
Outdated
|
||
export default class EventCard extends React.Component { | ||
//input: array of majors | ||
translate(majors) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this function doesn't really depend on anything in the EventCard
class or doesn't have anything to do with this file, put it in utils.js
(in src/
) and import it from there.
src/components/ControlPanel/event.js
Outdated
//input: array of majors | ||
translate(majors) { | ||
|
||
const majorMap = Config.majorMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix spacing
src/components/ControlPanel/event.js
Outdated
} | ||
|
||
let reducedMajors = majors.map(decideMajor); | ||
console.log(reducedMajors); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove debugging outputs
src/components/ControlPanel/event.js
Outdated
|
||
render() { | ||
|
||
this.translate(["computer science", "computer science and engineering", "electrical engineering", "mathematics of computation", "cognitive science", "linguistics and computer science", "math of computation", "applied mathematics", "undeclared engineering", "physics", "computer science & engineering", "computational and systems biology", "economics", "statistics", "mathematics", "bioengineering", "biochemistry", "mathematics/economics", "neuroscience", "chemistry", "mechanical engineering", "cs", "computer science engineering", "business economics", "cse", "civil engineering", "chemical engineering", "electrical and computer engineering", "math", "computational & systems biology", "computer engineering"]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this
src/components/ControlPanel/event.js
Outdated
this.translate(["computer science", "computer science and engineering", "electrical engineering", "mathematics of computation", "cognitive science", "linguistics and computer science", "math of computation", "applied mathematics", "undeclared engineering", "physics", "computer science & engineering", "computational and systems biology", "economics", "statistics", "mathematics", "bioengineering", "biochemistry", "mathematics/economics", "neuroscience", "chemistry", "mechanical engineering", "cs", "computer science engineering", "business economics", "cse", "civil engineering", "chemical engineering", "electrical and computer engineering", "math", "computational & systems biology", "computer engineering"]); | ||
|
||
const className = "event-card user-card"; | ||
return( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sure your indentation is consistent
src/components/ControlPanel/event.js
Outdated
|
||
this.translate(["computer science", "computer science and engineering", "electrical engineering", "mathematics of computation", "cognitive science", "linguistics and computer science", "math of computation", "applied mathematics", "undeclared engineering", "physics", "computer science & engineering", "computational and systems biology", "economics", "statistics", "mathematics", "bioengineering", "biochemistry", "mathematics/economics", "neuroscience", "chemistry", "mechanical engineering", "cs", "computer science engineering", "business economics", "cse", "civil engineering", "chemical engineering", "electrical and computer engineering", "math", "computational & systems biology", "computer engineering"]); | ||
|
||
const className = "event-card user-card"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this variable is unnecessary
src/components/ControlPanel/event.js
Outdated
return( | ||
<div className={className}> | ||
<div className="content"> | ||
<h2>THIS IS A VERY LONG EVENT TITLE THAT WILL OVERFLOW THE DIV</h2> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's change this back to something normal. When we add the reducer for event analytics, we can templatize all of these.
|
||
|
||
|
||
export default class EventAnalytics extends React.Component { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change this component to take in the data and labels through props instead of hard coding.
For example, you might pass in:
const yearData = { 1: 100, 2: 50, 3: 25, 4: 10 };
const majorData= { "CS/CSE": 300, "Ling CS": 100, "Math": 25 };
<EventAnalytics yearData={yearData} majorData={majorData} />
And then use the passed in objects to derive the labels, data, and display them.
Ok, I finished all requested changes. |
For each individual event, there is an event card that I mostly copied form components/UserEvents/event.js. Inside this event card, there are 2 graphs, one for year and one for major. All data is currently a placeholder.