Skip to content
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

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

alexanderqchen
Copy link
Contributor

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.

@alexanderqchen
Copy link
Contributor Author

I just pushed the changes from today. Let me know if anything needs to be changed!

</div>

<Event />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't commit this

@@ -0,0 +1,58 @@
//Edited from components/Events/UserEvents/event.js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove these comments


export default class EventCard extends React.Component {
//input: array of majors
translate(majors) {
Copy link
Contributor

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.

//input: array of majors
translate(majors) {

const majorMap = Config.majorMap;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix spacing

}

let reducedMajors = majors.map(decideMajor);
console.log(reducedMajors);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove debugging outputs


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"]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this

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(
Copy link
Contributor

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


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";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this variable is unnecessary

return(
<div className={className}>
<div className="content">
<h2>THIS IS A VERY LONG EVENT TITLE THAT WILL OVERFLOW THE DIV</h2>
Copy link
Contributor

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 {
Copy link
Contributor

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.

@alexanderqchen
Copy link
Contributor Author

Ok, I finished all requested changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants