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
Binary file added .DS_Store
Binary file not shown.
76 changes: 8 additions & 68 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,12 @@
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.
## DC Free Summer Meals Program Explorer

**Complete by October 23**
This dashboard is designed to display the DC Free Summer Meals Program operation sites, enabling users to easily search and find sites through various filtering options.

This Dashboard project includes the following features:

## Examples
* __Map View__: An interactive map that showcases the geographical locations and addresses of all sites involved in the program.
* __ZIP Code & Name Search__: Users can filter sites by entering specific ZIP codes and names.
* __Open Day and Meal Type Filters__: Users can select the types of meals and open days to find sites that offer their preferred options.
* __Dynamic Site List__: As filters are applied, a dynamic list updates to show the relevant sites based on the user's selections.

- School Explorer (in-class example), [examples/school-explorer-for-parents](examples/school-explorer-for-parents/site/)
- Philly Park Lead Levels, [examples/philly-park-lead-levels](examples/philly-park-lead-levels/)


## Instructions

### Step 1: Choose a topic

Choose a topic that is fruitfully explained with some combination of narrative and geographic elements. Stick with the data domain that you chose for your story map if you can. Think about 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.

Whatever data you use, **be sure to include citations somewhere in your app interface**.

### Step 2: Create a map on your browser

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



*This is the dashboard project for CPLN 6920.*
163 changes: 163 additions & 0 deletions css/map.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
body {
margin: 0;
font-family: Quicksand, serif;
overflow-y: hidden;
overflow-x: hidden;
}

.main-title {
width: 100%;
padding: 35px;
margin: 0;
text-align: left;
font-size: 50px;
position: relative;
}

.main-title .logo {
width: 160px;
height: auto;
margin-right: 15px;
}

.main-title .bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0.3;
object-fit: cover;
z-index: -1;
}

h1 {
font-size: 35px;
padding: 10px;
border-radius: 15px;
color: rgb(49 83 51);
font-weight: bold;
}

.container {
display: flex;
height: 100vh;
}

.sidebar {
width: 400px;
padding: 20px;
background: linear-gradient(to bottom, #fff 40%, #d0d0d0);
overflow-y: auto;
}

#map {
flex-grow: 1;
height: 100vh;
width: auto;
}

h3 {
font-size: 25px;
background-color: #f0f0f0;
padding: 10px;
border-radius: 5px;
color: rgb(96 119 80);
}

.searchbox {
width: 60%;
height: 35px;
padding: 10px;
border: 2px solid #9da7a1;
border-radius: 10px;
font-size: 14px;
box-sizing: border-box;
}


.filterbutton {
padding: 8px 12px;
font-size: 14px;
background-color: #4a8d60;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}

.filterbutton:hover {
background-color: #2d6436;
}

.filterbutton-reset{
padding: 8px 12px;
font-size: 14px;
border: none;
background-color: #e0e0e0;
border-radius: 4px;
cursor: pointer;
}

.filterbutton-reset:hover{
background-color: #afafaf;
}

input[type="checkbox"] {
transform: scale(1.5);
margin-right: 10px;
border-radius: 10px;
cursor: pointer;
}

.reset-button {
padding: 8px 12px;
font-size: 14px;
background-color: #4a8d60;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}

.reset-button:hover {
background-color: #2d6436;
}

.meal-types label {
display: block;
margin-bottom: 5px;
}

.days-open label {
display: block;
margin-bottom: 5px;
}

.site-list {
font-family: Itim, cursive;
margin-top: 20px;
}

.site-item {
margin-bottom: 5px;
padding: 5px;
border-radius: 8px;
background-color: #e0e0e0;
transition: background-color 0.3s;
}

.site-item:hover {
background-color: #e0faea;
}

.site-name {
font-size: 18px;
font-weight: bold;
color: #000;
}

.site-address {
font-size: 14px;
color: #888;
}
Loading