This project was generated with Angular CLI version 1.7.1.
run npm install to install the required modules
run ng serve to launch the app
-
The CSS uses the latest version of bootstrap's flexbox
-
The page was made to be responsive, but needs some clean up - the majority of the responsiveness is already there
-
The JSON file is located in assets/mock/test/test.json
-
I've created 114 random users in the file
-
I've made the post counts and the week numbers as random as they might appear in reality
-
The file data is fetched with a get in userSelectionComponent - HttpClient automatically unsubscribes after first emit, so no need to unsubscribe
- I've made the axis markers dynamicly adjust to the random week numbers and post numbers, so the markers are always relevant to the current selected user
I added a row selection dropdown that will add new rows to the user table, but I didn't have time to make a pager
I've made 4 components:
- userSelectionComponent = the main component for the user selection section
- userDataBarchartComponent = the bar chart
- userDataGeneralInfoComponent = the general info that appears to the left of the bar chart
- userDataTableComponent = the user listings table
There are comments for every function created within these components, as well as comments for the variables used
I've passed around some data between the components via @Input and also emitted user selections from the table component, to be used in the main component (this stores the selected user then passes that into the inputs of the chart and general info components)