Skip to content

Commit

Permalink
Add infrastructure for inactive clubs (fixes #26)
Browse files Browse the repository at this point in the history
  • Loading branch information
hftf committed Aug 13, 2024
1 parent 9c4d63a commit ba6efce
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion map/colleges.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ region active city state country lat long college_abbr college college_long
8A 1 Marquette MI USA 46.559603 -87.404487 Northern Michigan Northern Michigan University
8A 1 Madison WI USA 43.076592 -89.412487 Wisconsin University of Wisconsin-Madison
8A 1 Northfield MN USA 44.461768 -93.182817 St. Olaf St. Olaf College
8A 1 St. Peter MN USA 44.322162 -93.968777 Gustavus Adolphus Gustavus Adolphus College
8A 0 St. Peter MN USA 44.322162 -93.968777 Gustavus Adolphus Gustavus Adolphus College
8A 1 St. Paul MN USA 44.937893 -93.169043 Macalester Macalester College
8A 1 Carleton MN USA 44.461365 -93.155826 Carleton Carleton College
8A 1 Sioux Falls SD USA 43.522604 -96.739689 Augustana Augustana University
Expand Down
23 changes: 21 additions & 2 deletions map/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,23 @@ d3.tsv("colleges.tsv", function(error, colleges) {
.attr('class', 'region-label region-label-region region-label-id')
.text(d => d.id);

var circleClasses = {
2: 'circle-large',
1: 'circle-small',
0: 'circle-inactive',
}
var circleRadii = {
2: 4,
1: 2,
0: 2,
}
main.selectAll('.place')
.data(colleges)
.enter()
.append('circle')
.attr('class', d => (d.active > 1) ? 'circle-large' : 'circle-small')
.attr('class', d => circleClasses[d.active])
.attr('transform', d => 'translate(' + projection(d.coordinates) +')')
.attr('r', d => d.active * 2);
.attr('r', d => circleRadii[d.active]);


const voronoi = d3.geom.voronoi()
Expand Down Expand Up @@ -289,6 +299,10 @@ svg.append("text")
.attr('class', 'circle-small')
.attr('transform', d => 'translate(-16,68)')
.attr('r', 2);
legend.append('circle')
.attr('class', 'circle-inactive')
.attr('transform', d => 'translate(-16,92)')
.attr('r', 2);
legend.append('text')
// .attr('class', 'place-label')
.attr('class', 'legend-label-medium')
Expand All @@ -299,6 +313,11 @@ svg.append("text")
// .attr('class', 'place-label')
.attr('class', 'legend-label-medium')
.text('Attends tournaments');
legend.append('text')
.attr('transform', d => 'translate(0,96)')
// .attr('class', 'place-label')
.attr('class', 'legend-label-medium')
.text('Inactive');

legend.append('text')
.attr('transform', d => 'translate(32,-40)')
Expand Down
5 changes: 5 additions & 0 deletions map/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@
/*font-family: 'BentonSansCond', sans-serif;*/
}

circle.circle-inactive {
fill: #888;
stroke: #666;
stroke-width: 1px;
}
circle.circle-small {
/*fill: #3dab89d8;*/
fill: white;
Expand Down

0 comments on commit ba6efce

Please sign in to comment.