-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from codepath/update-test-suite
Updated starter with most recent test adjustments
- Loading branch information
Showing
7 changed files
with
362 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
import data from "./normalized-fast-food-feud.json" | ||
|
||
export const getUniqueCategories = (d) => [...new Set(d.map((row) => row.food_category))] | ||
export const getUniqueRestaurants = (d) => [...new Set(d.map((row) => row.restaurant))] | ||
|
||
export const createDataSet = () => { | ||
return { | ||
data, | ||
restaurants: getUniqueRestaurants(data), | ||
categories: getUniqueCategories(data), | ||
} | ||
export const Dataset = { | ||
getUniqueCategories: (d) => [...new Set(d.map((row) => row.food_category))], | ||
getUniqueRestaurants: (d) => [...new Set(d.map((row) => row.restaurant))], | ||
createDataSet: () => { | ||
return { | ||
data, | ||
restaurants: Dataset.getUniqueRestaurants(data), | ||
categories: Dataset.getUniqueCategories(data), | ||
} | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.