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

Feedback #1

Open
wants to merge 140 commits into
base: feedback
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
140 commits
Select commit Hold shift + click to select a range
04bcaa4
Setting up GitHub Classroom Feedback
github-classroom[bot] Apr 27, 2021
041d318
created react app
itstabya Apr 28, 2021
55bd4b7
working with index.html, deleted mapbox scrollytelling, kept react pr…
itstabya May 1, 2021
1bb1fd4
added react version
itstabya May 2, 2021
bf4b8fe
deleted react
itstabya May 2, 2021
2836671
cleaned up
jodihuang10 May 2, 2021
f4e88e5
restructure
jodihuang10 May 2, 2021
2f5ae91
added geojson
itstabya May 2, 2021
4bd0bd7
data incompleteness section
jodihuang10 May 2, 2021
f9bc4ae
data incompleteness section
jodihuang10 May 2, 2021
5227a25
Add more datas
allanaz May 2, 2021
659603f
added circle marks
itstabya May 2, 2021
2596657
fixed merge conflict with jodi 20 br
itstabya May 2, 2021
2df6046
changed data source to github links
itstabya May 2, 2021
bc81704
added markers for beginning famous names
itstabya May 2, 2021
549f20a
added more chapters for mvp, centered features
itstabya May 2, 2021
2d77013
start something from allan
allanaz May 2, 2021
5e9a804
Merge branch 'main' of https://github.com/6859-sp21/final-project-pol…
allanaz May 2, 2021
f8c783d
incorporated simple d3 visualization
jodihuang10 May 2, 2021
9dfa410
Merge branch 'main' of https://github.com/6859-sp21/final-project-pol…
jodihuang10 May 2, 2021
e7d7b1b
incorporated simple d3 visualization
jodihuang10 May 2, 2021
2c8e5ae
fixed empty names
jodihuang10 May 2, 2021
eea7513
work on use of force participation data
allanaz May 3, 2021
2ea08bd
dark map
itstabya May 3, 2021
a7bc616
Merge branch 'main' of https://github.com/6859-sp21/final-project-pol…
itstabya May 3, 2021
f431ff3
working on a map
allanaz May 3, 2021
fa2a9f9
Merge branch 'main' of https://github.com/6859-sp21/final-project-pol…
allanaz May 3, 2021
a9382d2
change txt to json
allanaz May 3, 2021
d7342b7
removed incorrect coordinates
jodihuang10 May 3, 2021
115e2ac
Merge branch 'main' of https://github.com/6859-sp21/final-project-pol…
jodihuang10 May 3, 2021
34a3f88
removed incorrect coordinates
jodihuang10 May 3, 2021
0a03449
formatted csv
jodihuang10 May 3, 2021
9bd7f89
attempted circle chart
itstabya May 3, 2021
382126e
merge connflict
itstabya May 3, 2021
34ca2fa
converted to geojson for total departments
itstabya May 3, 2021
5e95d5d
added pie chart
jodihuang10 May 3, 2021
1df5abb
Merge branch 'main' of https://github.com/6859-sp21/final-project-pol…
jodihuang10 May 3, 2021
0c981d9
make map work
allanaz May 3, 2021
bb62a9d
Merge branch 'main' of https://github.com/6859-sp21/final-project-pol…
allanaz May 3, 2021
7ea9029
Add map to the scroll map
allanaz May 3, 2021
3166acd
Add title and description to the use of force map
allanaz May 3, 2021
b52ac9b
added visualization pie chart
itstabya May 3, 2021
22cbede
adjustment for mvp
itstabya May 3, 2021
293d573
renamed map scroll
itstabya May 12, 2021
180ab36
added state geometries
jodihuang10 May 12, 2021
01ddd86
total departments geojson test
jodihuang10 May 12, 2021
ae471f3
trying to add legend to circle chart
itstabya May 16, 2021
486a76c
merge conflict
itstabya May 16, 2021
bd6a682
added choropleth at relevant area
itstabya May 16, 2021
f3b8302
testing total departments geojson
jodihuang10 May 16, 2021
469ee04
testing total departments geojson
jodihuang10 May 16, 2021
d83878a
testing total departments geojson
jodihuang10 May 16, 2021
e087cea
testing total departments geojson
jodihuang10 May 16, 2021
c1d8bce
testing total departments geojson
jodihuang10 May 16, 2021
a590b6a
basic code for animations
itstabya May 16, 2021
79315e3
Merge branch 'main' of https://github.com/6859-sp21/final-project-pol…
itstabya May 16, 2021
1e764ec
moved choropleth to back
jodihuang10 May 16, 2021
4f9fa09
Merge branch 'main' of https://github.com/6859-sp21/final-project-pol…
jodihuang10 May 16, 2021
4274406
formatted animations
jodihuang10 May 16, 2021
d50b976
cleaned code
jodihuang10 May 16, 2021
db04214
updated tooltips
itstabya May 16, 2021
0ad1f1a
merge conflict
itstabya May 16, 2021
304db1f
fixed merge conflict error with map js
itstabya May 16, 2021
a50ff78
added color to the map for marginalized communities
itstabya May 17, 2021
08325cd
legislation graph and beginnings of dod loan program
allanaz May 17, 2021
dde7176
complete merge?
allanaz May 17, 2021
14957d5
babsic implmentation of bbutton instead of radio
itstabya May 17, 2021
ed8a49f
Merge branch 'main' of https://github.com/6859-sp21/final-project-pol…
itstabya May 17, 2021
990c83d
add bar chart
allanaz May 17, 2021
4981261
Merge branch 'main' of https://github.com/6859-sp21/final-project-pol…
allanaz May 17, 2021
cabf009
basic styling to get an idea
itstabya May 17, 2021
eb4e542
merge conflict
itstabya May 17, 2021
2d1a512
process 1033 data
allanaz May 17, 2021
23de6a0
Merge branch 'main' of https://github.com/6859-sp21/final-project-pol…
allanaz May 17, 2021
d18a880
process data into shape for stack, and extract cumulative numbers for…
allanaz May 17, 2021
55d2e40
restructuring for narrative flow
itstabya May 17, 2021
9971fa3
Add militarization graph
allanaz May 17, 2021
39fb41b
fix merge conflicts in map and d3_vis
allanaz May 17, 2021
1aef633
something didnt save
allanaz May 17, 2021
7e5bf65
trying to structure rows and oclumns
itstabya May 17, 2021
ed34273
adding MPV data for csv
itstabya May 17, 2021
9da6a1d
fix year display on zoom in of militarization plot
allanaz May 18, 2021
5ad213e
attempting heatmap
itstabya May 18, 2021
6cdc79e
Merge branch 'main' of https://github.com/6859-sp21/final-project-pol…
itstabya May 18, 2021
1a4f2d7
the calendar heat maps work
allanaz May 18, 2021
67cc8a5
clean up calendar and show the numbers on the label
allanaz May 18, 2021
69b9b2a
styilng around world issue
itstabya May 18, 2021
6c0ce1c
merge
itstabya May 18, 2021
bac7670
map hover info
jodihuang10 May 18, 2021
2f328b1
merge
jodihuang10 May 18, 2021
629b08c
persisting red dots
jodihuang10 May 18, 2021
df98a37
first draft of militarization explanation
allanaz May 18, 2021
4fee3dd
fix merge conflict
allanaz May 18, 2021
e8414d6
try new colors, clean up some of the styling/organization
allanaz May 19, 2021
1c3355a
updated adam toledo
itstabya May 19, 2021
1a27526
Merge branch 'main' of https://github.com/6859-sp21/final-project-pol…
itstabya May 19, 2021
edc5575
added breonna taylor
itstabya May 19, 2021
e3bc678
two pie charts instead of 1
itstabya May 19, 2021
d7b9ca9
add text to legislation section
allanaz May 19, 2021
b73912a
Merge branch 'main' of https://github.com/6859-sp21/final-project-pol…
allanaz May 19, 2021
dfbc174
new orientation for pie
itstabya May 19, 2021
b3fe450
Merge branch 'main' of https://github.com/6859-sp21/final-project-pol…
itstabya May 19, 2021
dc7d4c4
added coloring
itstabya May 19, 2021
4e1ded6
font pairing
itstabya May 19, 2021
ae8b1fd
adam toledo humianization as well as title sldie
itstabya May 19, 2021
ce44183
basic css formatting
jodihuang10 May 19, 2021
fbfedb1
wild merge
jodihuang10 May 19, 2021
1fa244f
removed red dots from missing data
jodihuang10 May 19, 2021
d8a69b0
css changes + testing on different screens
jodihuang10 May 19, 2021
e1b8be8
map changes
jodihuang10 May 19, 2021
85391e4
formatting changes
jodihuang10 May 19, 2021
80260ac
started readme
itstabya May 19, 2021
462296b
Merge branch 'main' of https://github.com/6859-sp21/final-project-pol…
itstabya May 19, 2021
84bbfa1
formatting changes
jodihuang10 May 19, 2021
9ac9d7b
Merge branch 'main' of https://github.com/6859-sp21/final-project-pol…
jodihuang10 May 19, 2021
10a7e07
change map for first section
jodihuang10 May 19, 2021
eccd180
heading margins
itstabya May 19, 2021
3e1c3a2
Merge branch 'main' of https://github.com/6859-sp21/final-project-pol…
itstabya May 19, 2021
58bf2f7
formatting changes
jodihuang10 May 19, 2021
e2d3f59
Merge branch 'main' of https://github.com/6859-sp21/final-project-pol…
jodihuang10 May 19, 2021
c8659c2
fixed image
jodihuang10 May 19, 2021
8e6f9a7
conclusion nstuff
itstabya May 19, 2021
6f5a6c1
Merge branch 'main' of https://github.com/6859-sp21/final-project-pol…
itstabya May 19, 2021
0c4c4dc
added resources
jodihuang10 May 19, 2021
b76eb8e
added resources
jodihuang10 May 19, 2021
8a14e94
added summary image
jodihuang10 May 19, 2021
6eda019
summary image on readme test
jodihuang10 May 19, 2021
f3aed46
readme test
jodihuang10 May 19, 2021
8d8d352
readme abstract
jodihuang10 May 19, 2021
123ced8
readme addition for project process
itstabya May 19, 2021
0628a1a
Merge branch 'main' of https://github.com/6859-sp21/final-project-pol…
itstabya May 19, 2021
c0d1a80
added more resources
itstabya May 19, 2021
f686370
minor visualization fixes
jodihuang10 May 20, 2021
86060ff
final edits to language in last two sections
allanaz May 20, 2021
1be1ded
Merge branch 'main' of https://github.com/6859-sp21/final-project-pol…
allanaz May 20, 2021
70ab68e
minor edits that seem to need to be committed
itstabya May 20, 2021
6f55ea4
Merge branch 'main' of https://github.com/6859-sp21/final-project-pol…
itstabya May 20, 2021
3157e3e
add final apper
itstabya May 20, 2021
ed27b7a
changed small wording
itstabya May 20, 2021
c87876a
moved paper to final folder
itstabya May 20, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed .github/.keep
Empty file.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.DS_Store
*.xlsx
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,33 @@
# final-project-starter-code
Project Page: List title, team members, summary image, abstract, link to the paper, video, running instructions for the software, and other optional materials. Preferrably host the page with Github Pages.

Readme File: In the repository’s readme.md, include a breakdown of how the work was split among the group members and a commentary on the project process.

## Project
### Title: Police Brutality in the United States
#### Team Members: Allan Garcia-Zych, Jodi Huang, Tanya Yang

![alt text](https://github.com/6859-sp21/final-project-police-brutality/blob/main/img/summary.png)

Abstract:
The authors employ scrollytelling over a map of the United States with a red marker at the location of every fatal police shooting since 2015 to walk the user through various layers of police brutality. Sub-visualizations are provided to support the exploration and case studies are presented as a connection to fatal police shootings that the user might be familiar with. Recognizing that the user likely understands that police brutality is a serious issue, the authors aim to broaden and deepen this understanding by exploring main facets such as marginalized communities and police militarization.

Link to paper: The paper is within the project, at final/FinalPaper.pdf.

The video can be found [here](https://www.loom.com/share/9ea3c7949bd44d97bdadd98e91ec6724).

Running instructions: Simply download this Github repo and open up index.html.


## Project Details
### Commentary on Project Process
The project initially started as an exploration into voter turnout, but the authors shifted to the topic of police brutality because they wanted to tackle an issue more present in the news and understand the relationship that visualizations might have with such an issue. The authors were first focused on the few intense cases that had been the driving force of most police reform conversations throughout the past year, with the killings of George Floyd, Breonna Taylor, Adam Toledo, and countless more.

From these cases, the authors quickly realized that police brutality was a much more multidimensional issue than they had once perceived. They spent a significant amount of time determining the particular case studies for the project, eventually deciding with impact on marginalized communities, militarization on police, legislation rates,and finally missing data. However, there are still so many facets of police brutality to encompass – these only serve as a starting point.

The project proceeded with detailed examination on relevant datasets, and the availability and depth of the data informed the types of visualizations to employ. The authors decided on a multitude of visualizations instead of one large detailed one to further highlight the different parts of the probblem. The various visualizations emphasize breadth over depth but are fundamentally anchored by the background map.

Finally, the last part of the process was comprised of styling and formatting.

### Breakdown of Work

All three authors contributed to the outlining of the narrative. Allan worked on the visualizations for legislation, militarization, and the calendar view, as well as some of their corresponding writing sections. Jodi worked on an accountabiltiy section (which we unfortunately could not fit at the end) as well as the missing data choropleth. She also contributed heavily to the formatting of the scrollytelling. Tanya worked on the marginalized community pie charts as well as the specific case studies accompanying many of the visualiations, with connections to the very current cases of Breonna Taylor and Adam Toledo. She also worked on the overall styling of the piece, with color and font selections.
144 changes: 144 additions & 0 deletions calendar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
function drawCalendar(myData) {

var calendarRows = function(month) {
var m = d3.timeMonth.floor(month);
return d3.timeWeeks(d3.timeWeek.floor(m), d3.timeMonth.offset(m,1)).length;
}

var minDate = new Date(2021, 0, 1);
var maxDate = new Date(2021, 3, 21);

var cellMargin = 2,
cellSize = 20;

var day = d3.timeFormat("%w"),
week = d3.timeFormat("%U"),
format = d3.timeFormat("%Y-%m-%d"),
titleFormat = d3.utcFormat("%a, %d-%b"),
monthName = d3.timeFormat("%B"),
months= d3.timeMonth.range(d3.timeMonth.floor(minDate), maxDate);

var color = d3.scaleOrdinal()
.domain([0, 10])
.range(["#a6cee3","#fb9a99","#b2df8a", "#fdbf6f","#cab2d6","#ffff99"])

var svg = d3.select("#d3-calendar").selectAll("svg")
.data(months)
.enter().append("svg")
.attr("class", "month")
.attr("width", (cellSize * 7) + (cellMargin * 8) )
.attr("height", function(d) {
var rows = calendarRows(d);
return (cellSize * rows) + (cellMargin * (rows + 1)) + 20; // the 20 is for the month labels
})
.append("g")

svg.append("text")
.attr("class", "month-name")
.attr("x", ((cellSize * 7) + (cellMargin * 8)) / 2 )
.attr("y", 15)
.attr("text-anchor", "middle")
.text(function(d) { return monthName(d); })
.attr('font-family', 'Crimson Text')

var scale = d3.scaleLinear()
.domain(d3.extent(myData, function(d) { return d.count; }))
.range([0.4,1]); // the interpolate used for color expects a number in the range [0,1] but i don't want the lightest part of the color scheme

var rect = svg.selectAll("rect.day")
.data(function(d, i) {
return d3.timeDays(d, new Date(d.getFullYear(), d.getMonth()+1, 1));
})
.enter().append("rect")
.attr("class", "day")
.attr("width", cellSize)
.attr("height", cellSize)
.attr("rx", 3).attr("ry", 3) // rounded corners
.attr("fill", d => '#eaeaea') // default light grey fill
.attr("x", function(d) {
return (day(d) * cellSize) + (day(d) * cellMargin) + cellMargin;
})
.attr("y", function(d) {
return ((week(d) - week(new Date(d.getFullYear(),d.getMonth(),1))) * cellSize) +
((week(d) - week(new Date(d.getFullYear(),d.getMonth(),1))) * cellMargin) +
cellMargin + 20;
})
.attr("margin-top", "10px")
.on("mouseover", function(d) {
d3.select(this).classed('hover', true);
})
.on("mouseout", function(d) {
d3.select(this).classed('hover', false);
})
.datum(format);

rect.append("title")
.text(function(d) {

return titleFormat(new Date(d)); });

let countsByDate = d3.group(myData, d => (new Date(d.date)).toDateString());


rect.filter(function(d) { return d; })
.style("fill", function(d) {
let dayBefore = new Date(d);
let result = new Date(dayBefore);
result.setDate(result.getDate() + 1);
let dayResult = countsByDate.get(result.toDateString());
let count = 0;
if (typeof dayResult != "undefined"){
count = dayResult[0].count;
if (count === 0){
console.log( dayResult );
console.log((new Date(d)).toDateString())
}
}
if (count === 0){
return "eaeaea";
}
return d3.interpolateReds(scale(count)); })
.select("title")
.text(function(d) {
let dayBefore = new Date(d);
let result = new Date(dayBefore);
result.setDate(result.getDate() + 1);
let dayResult = countsByDate.get(result.toDateString());
let count = 0;
if (typeof dayResult != "undefined"){
count = dayResult[0].count;
if (count === 0){
console.log( dayResult );
console.log((new Date(d)).toDateString())
}
}
return titleFormat(new Date(d)) + ": " + count; });

}

d3.csv("https://raw.githubusercontent.com/6859-sp21/final-project-police-brutality/main/data/MPVDatasetDownload-csv.csv").then((data) => {
thisYearData = data.filter(d => d["Date of Incident (month/day/year)"].slice(-2) === "21");
counted2021Date = {}
thisYearData.forEach(d => {
let date = new Date(d["Date of Incident (month/day/year)"]);
counted2021Date[date] = (counted2021Date[date] || 0) + 1;
})

// convert object to array of objects
let allDates = []
Object.keys(counted2021Date).forEach(d => {
allDates.push({date: d, count: counted2021Date[d]})
})

let missingDates = [new Date(2021, 0, 16), new Date(2021, 0, 23), new Date(2021, 2, 2)]
missingDates.forEach(d => {
allDates.push({date: d, count: 0})})

let allDatesSorted = allDates.slice().sort((a, b) => b.date-a.date)

drawCalendar(allDatesSorted)




});
Loading