cs1951a_install data_viz
or cp -r /course/cs1951a/pub/data_viz/stencil ~/course/cs1951a/data_viz
cs1951a_handin data_viz
dashboard.html
, main.js
, main.css
, README.txt
Bad Data Viz is in fact the theme of our website. So, please let us indulge by listing just a few more examples here:
In this assignment, you will use D3, an interactive visualization library,
to develop your own data dashboard. D3 is extremely powerful and can be used to make very specific,
informative diagrams. We highly recommend that you complete the D3 + JavaScript
lab before you attempt this assignment. We have a ton of explanation and introduction to D3
in the lab.
To illustrate the capabilities of D3, here are some stunning examples of visualizations created with it:
We know that D3 code is easy to find online. Even if we provide you with reference implementations, do not copy any code.
Many students find this assignment to be one of the most challenging in the class. This is because JavaScript is a new language and framework for many, and we don't formally teach it. We HIGHLY recommend you walk through the lab listed here before you begin. The solution code for the D3 lab is a great place for starter code on how to create your own graphs for this assignment.
Since this project is more free-form than previous assignment, there is no solution code for this assignment. We will do our best to debug your dashboard during TA hours, but TAs at hours can only be so helpful debugging your particular project. A few tips:
Your task is to create your own informative D3 dashboard! This assignment, in particular, is very flexible. There are no strictly correct or incorrect answers since visualization is inherently subjective. That said, we will evaluate your work on a number of requirements listed below. Further, we expect that you incorporate concepts that Ellie has discussed in class like color palettes, font types/sizing, orientation, clarity, organization, and informativeness.
You must use data from one of the following datasets. Each dataset has a series of leading questions you may use as inspiration. You should make sure that your dashboard answers these questions. Imagine your boss gives you 2 weeks to build a dashboard on these issues.
Note: All 3 datasets are provided in the data
directory under the data_viz
folder. Each topic includes a link to a Kaggle site with more information about the dataset.
dashboard.html
with your JavaScript D3 code in main.js
and any custom styling in main.css
. Feel free to add new JavaScript files if you want.
Unique graphs are bar, line, scatter plot, heatmap, density, area, etc. You can see examples here. In our stencil we have setup three boxes for you to place your graphs, but you can feel free to adjust these based on your graph selection.
We define this as a clickable/writeable element that updates the graphs/look of the dashboard.
We define this as information which appears when users hover over a data point‐ this can be combined with your clickable element, but a tooltip alone is not considered interactive.
We will evaluate your graph communication two-fold. Each graph will assessed 1) how well it communicates the information of the graph 2) how well it answers the question.
We've already included D3 and Bootstrap in the stencil code provided. To perform statistical calculations
take a look at jStat
and d3-regression
.
If you would like to use either of these libraries, add the following lines to your dashboard.html
file:
<script> type="text/javascript" src="https://cdn.jsdelivr.net/npm/jstat@latest/dist/jstat.min.js"></script>
<script> type="text/javascript" src="https://unpkg.com/d3-regression@1.3.4/dist/d3-regression.min.js"> </script>
dashboard.html
file, and run
python -m http.server 8000You then can open a browser to the url
http://localhost:8000/dashboard.html
to view your
dashboard.
Another alternative is to set up port forwarding. This will allow you to edit your code over SSH and view
your resulting dashboard locally.
When port forwarding, have two terminal windows open.
cslab6e
)
python -m http.server 8000
ssh <your login>@ssh.cs.brown.edu -N -L 8000:[HOSTNAME]:8000Using
cslab6e
as the example, your command would be
ssh <your login>@ssh.cs.brown.edu -N -L 8000:cslab6e:8000
http://localhost:8000/dashboard.html
to view your
dashboard, and edits you make on the department machine will be reflected on the dashboard you are
viewing on your local machine.
This assignment is completely in javascript and html. This means that it does not require packages or python to run! We recommend using the python http server to host the page as that is responsive. As such, if you install base python3 (or 2), have a text editor, and a web browser you can run this assignment natively on your machine. You should confirm things work the same (we have no reason to believe they wouldn't) on the department before handing in, but we do encourage you to develop locally if that is easy for you.
dashboard.html
:
Hopefully through this exercise, you've all seen how data visualizations are powerful tools that we can leverage
to efficiently and easily communicate ideas. However, not all graphs/charts are made equal. Read this article on
misleading graphs and answer the
following questions underneath your dashboard in dashboard.html
as well.
If you enjoyed the reading or want to see some more real life examples of flawed visualizations (and how they could be improved), feel free to read the following articles as well. However, these are not required.
Your ~/course/cs1951a/data_viz/
must contain at least the following:
dashboard.html
main.js
main.css
README.txt
- containing anything you'd like the TAs to know about your handincs1951a_handin data_viz
.
This assignment was created in Spring 2020 by Arvind Yalavarti (ayalava2) and Joshua Levin (jlevin1).