College Vivisection

College Vivisection is a data-driven WordPress site that features an interactive, filterable map of US colleges and universities that conduct animal experimentation. Filters are by state or by ranking. These schools are given scores of "Bad", "Worse", and "Worst" based off a scoring algorithm that takes into consideration the total funding a school received, the number of reported violations, and the total number of animals used in experiments that are covered under the federal Animal Welfare Act (AWA). A controversial subject for sure, the website itself features a number of interesting front-end and back-end admin features.

As the sole developer, this project allowed me to not only create a custom API via the WordPress API, but also work with a mapping library (Leaflet.js), a third-party API (Mapquest API), and provide admin features for quick data management.

Frontend Features

A map with clickable filters to display different datasetsThe map on the homepage can be filtered to display schools that are marked "Bad", "Worse", or "Worst".

On filter click, javascript will set a query string such as ?filter=bad or ?state=alabama in the URL by using the History web API, so that it can be bookmarked and directly accessed. On page load, the javascript on the homepage checks for any query strings and if so, will show the appropriate map markers after making an API call to the correct endpoint.

Clicking a state selection in the dropdownThe colleges can be filtered via its specific location as well.

The "Browse the List" page features a sortable, searchable, and paginated table that displays all of the colleges and their ranking, state, and total animals experimented on (excluding mice, rats, birds, lizards, fish, or agricultural animals). You can sort alphabetically, by state, by animals experimented on, or by ranking.

Each individual College page features a chart

Admin Features

The colleges and their respective data (eg: number of violations per each year, the number of each different type of animal, their location data) was imported from a massive Excel spreadsheet, with columns corresponding to different post meta fields. However, while these colleges and universities had their addresses listed, not every entry had the correct location data, and every entry still needed to have their "cruelty ranking" and score generated, based off their data.

Since there were over 700+ colleges in the Excel sheet, it would make no sense to manually calculate and input the ranking, score, or latitude/longitude coordinates. I created a settings page in the WordPress admin area where a user could generate rank & score, latitude & longitude, or convert state abbreviations to their full state name.

The Rank & Score generator goes through each College post type and calculates their score and sets rank based off the data from the current year's animal data. Although these fields update when you save a post, if you were to create new posts by importing data from a spreadsheet, the fields do not update. Each College post then has its ranking and score postmeta updated in the database.

The Longitude & Latitude generator sets coordinates based off a zip code, if it has been set in the post meta and that zip code is a valid US zip code. It makes use of the MapQuest Batch Geocoding API to grab and set coordinates. The batches are limited to 100 locations at a time, so the javascript that calls the API splits the total number of posts into sliced arrays of 100 elements, and does a call for each of those slices.

Converting State Abbreviations is a simple call that sets location data from a 2-letter state abbreviation to its full name. For example, "VA" is turned into "Virginia."

Year: 2019