Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
34 changes: 34 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Example Workflow

on:
push:
branches: [ main, gh-pages ]

jobs:
upload:
strategy:
matrix:
runs-on: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.runs-on }}
steps:
- name: Create a File
run: echo "hello from ${{ matrix.runs-on }}" > file-${{ matrix.runs-on }}.txt

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: my-artifact-${{ matrix.runs-on }}
path: file-${{ matrix.runs-on }}.txt

download:
needs: upload
runs-on: ubuntu-latest
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
path: my-artifact
pattern: my-artifact-*
merge-multiple: true

- run: ls -R my-artifact
25 changes: 0 additions & 25 deletions .github/workflows/lint-css-files.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/lint-js-files.yml

This file was deleted.

32 changes: 31 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
node_modules/
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
src/data/inspectPanel.json
src/data/tractPanel.json
src/data/councilPanel.json
public/data/inspectPanel.json
public/data/tractPanel.json
public/data/councilPanel.json
public/data/violations_small.json
8 changes: 8 additions & 0 deletions .vite/deps/_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"hash": "aec6e8df",
"configHash": "e94413a0",
"lockfileHash": "e3b0c442",
"browserHash": "89d8b23c",
"optimized": {},
"chunks": {}
}
3 changes: 3 additions & 0 deletions .vite/deps/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
76 changes: 16 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,24 @@
Dashboards are the bread and butter of spatial data displays. They are highly interactive websites, usually with real-time updates that show data in an accessible way.
# Overview
This dashboard was created as a visual tool to see the spatial distribution of residential code enforcement implementation.The violations, represented by the point markers, are overlaid on top of ACS tract-level data. A KPI panel populates pertinent information about the filtered violation as the user adjusts their view.

# Instructions
The user can filter the violations by location, year, type, status, priority, council district, and L&I enforcement district. They also have the option to switch between several ACS metrics, including data on income, poverty, standardized concentration of different racial groups, and housing costs.

## Instructions

### Step 1: Choose a topic
# Data
The following data was sourced from the City of Philadelphia via [OpenDataPhilly](www.opendataphilly.org):
- **Violations**: (https://opendataphilly.org/datasets/licenses-and-inspections-code-violations/)
- **2014 L&I Districts**: (https://opendataphilly.org/datasets/licenses-and-inspections-districts/)
- **2024 Council Districts**: (https://opendataphilly.org/datasets/city-council-districts/)

Choose a topic that is fruitfully explained with some combination of narrative and geographic elements. Think about what data you want to tell a story about, and what kind of decisions you want to support through the use of your dashboard. Evaluate any dataset or interactive element you add to your dashboard on whether it makes it actually supports making those decisions.
Neighborhood characteristics were pulled from the United States Census 2023 ACS 5-Year Survey.

Whatever data you use, **be sure to include citations somewhere in your app interface**. You can choose a dataset from any of a number of sources, for example:

* Use data you've been working with for another class
* Create your own dataset (check out [geojson.io](https://geojson.io))
* Find data from an open data repository...
# Contact
Sydney Jones, MCP/MUSA '27
University of Pennsylvania Weitzman School of Design
[sydneyjw@upenn.edu](mailto: sydneyjw@upenn.edu)

### Step 2: Create a map on your browser
This dashboard is a part of a larger project examining residential code enforcement practices across Philadelphia. Feel free to reach out with any questions, comments, or suggestions.

The main component of the dashboard is the map displayign spatial information. This is the building block of all your other features!

* Create basic html with head and body elements, linking to your css stylesheet and javascript file
* Create map element in html document
* Style map element in CSS to give it height
* Create map object in Javascript referencing leaflet quickstart https://leafletjs.com/examples/quick-start/ (will need to link to leaflet documents in your html)
* Add a basemap tile layer - use OpenStreetMap, Stamen, Mapbox, or another source - you can customize this!
* NOTE: you may want to separate the code for creating the map into a different javascript file for organization. If you do this, wrap the creation of the map into a function and export that function, and then import it in your main.js file.

### Step 3: Add data to your map

* Add data file to your repository folder (usually in a data subfolder) - remember geojson files work best, csv files work too but must be parsed using csv parse https://csv.js.org/parse/ or papa parse https://www.papaparse.com/ . See [the course resources](https://github.com/musa-6110-fall-2023/course-info/blob/main/resources/data-format-csv.md) for a guide to getting started with those libraries.
* Use fetch API https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API to load your data into your environment (remember, fetch returns a promise, not a file, and a file needs to be extracted from the promise)
* Create map layer to display data (ie LayerGroup, Marker, etc.. see documentation https://leafletjs.com/reference.html) - style the layer here, not in CSS because CSS cannot access styles within the map
* Display data through your map layer (either create an empty layer and pass the data through in a separate function, or input the data directly when you create the layer)
* optional: attach popup https://leafletjs.com/reference.html#popup and tooltip https://leafletjs.com/reference.html#tooltip to your data layer for more interactivity

### Step 4: Create an interactive element (ie search, highlight, print data, etc)

This is the most broad step because you could do so many different things like:
* button to filter data shown on map
* checkbox to filter data shown on map
* search bar to type in to filter data shown on map (more difficult - try only if you've already accomplished the button)
* paste/display text of data attributes when you click on the data layer on the map
* graph data shown on map

The general steps to accomplish these are:
* create an html element for the interactive piece (ie button, checkbox, searchbar, graph) ps. if you're interactive event will be clicking on the map, no extra element is needed
* create a DOM (document object model) element in javascript to set up an event listener - reference DOM exercise we did in class https://github.com/musa-6110-fall-2023/dom-exercises
* create an event listener (event examples: click a button, check a checkbox, click a map data layer)
* create a function which responds when the event has happened
* create a function to parse through data (will require for loop) and accomplish one of the following:
* clear data layer and display only the filtered data
* print in space outside map (new html element) information about the data
* pass data shown on map through a graph and display

### Step 5: Finishing touches (styling, linting, accessibility)

* style the map and data to your liking, which can include doing things like:
* customizing your basemap tiles
* customizing your marker/data layer style (using your own image in replace for the marker image)
* changing fonts and colors in the csv

Make sure to lint use eslint or stylelint to ensure your code is using the widely acceptable syntax

Check for accessibility using:
* Axe DevTools in browser
* accessible colors for someone looking at your map, reference colorbrewer or other sites for help with this



**Note**: ChatGPT was used to assist with the technical portion of this project.
9 changes: 9 additions & 0 deletions USERPERSONA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

# Primary User
This dashboard was built as a tool for Philadelphia City Councilmembers to visualize code enforcement implementation within their district.

## Needs
Councilmembers and their teams can see the spatial distribution of violations across their district overlaid on top of a choropleth of different neighborhood characteristics. They can filter by year, severity of violation, case status, and other metrics.

## Motivations
This tool can help elected officials choose areas to target for resource infusion. Ideally, the tool would be used as a preventative measure to help guide decisions on targeted outreach for home owners and tenants in need of home repairs. The most common violations are for overgrown weeds and exterior maintenance, issues that can be addressed with relatively low-cost solutions that may be inaccessible to different residents due to economic, mobility, and temporal constraints, among others. Providing residents with assistance before they interact with code enforcement can help to prevent the excessive issuance of violations, costly fines and fees, and the potential health problems common with living in substandard housing.
Loading