Viewing a saved revision (read-only)
bS3peyC5OcFFbnr5KlH_S
Created from react-d3-starter template
NYC Restaurant Neighborhood Datasets
An interactive choropleth maps the count of restaurant records in restaurants.csv to neighborhood polygons in nbhd.geo.json. The map only includes features whose GeoJSON properties.id matches a restaurant nbhd_id; it does not infer matches from neighborhood names.
Dataset inventory
Counts below are those supplied in the project profile. The JSON profile reports each JSON file as one top-level object; that is not the number of records/features nested within it.
restaurants.csv
- Known size: 30,605 data rows; 12 columns.
- Apparent subject: restaurant inspection/listing records with restaurant identity, classification, neighborhood and coordinates.
- Parsing: loaded with D3
csv, which parses a standards-compliant CSV record stream. The header is the first CSV record, not a presumed physical line; quoted fields and embedded newlines are handled by the parser. D3 initially returns cell values as strings. Numeric coordinates are converted only for validation; counts use records, not CAMIS deduplication. - Missingness: the supplied profile reports zero missing values in all fields. This does not rule out blank strings or semantic invalidity; the visualization rejects invalid coordinates and skips blank neighborhood IDs.
| Exact field | Tentative meaning | Munzner classification |
|---|---|---|
camis |
Restaurant/city inspection identifier; profile says numeric, but identifier values should be treated as labels, not measurements. | Nominal |
name |
Restaurant name as recorded. | Nominal |
brand |
Brand/group label. | Nominal |
brand_locations |
Number of locations associated with the brand; numeric quantity. | Quantitative |
tier |
Restaurant/chain-size classification. | Ordinal only if the category definitions establish an order; otherwise nominal. |
cuisine |
Cuisine category. | Nominal |
lat |
Latitude in decimal degrees. | Geographic coordinates |
lon |
Longitude in decimal degrees. | Geographic coordinates |
nbhd_id |
Neighborhood identifier. | Geographic identifier |
nbhd_name |
Neighborhood name label. | Geographic identifier |
boro |
Borough label. | Geographic identifier |
not_yet_inspected |
Boolean inspection-status indicator. | Nominal (binary) |
No explicit temporal field is present. Restaurant coordinates are accepted only when both values parse to finite numbers within valid latitude/longitude ranges. The visualization counts input records; if multiple rows refer to one establishment, the count is not a distinct-establishment count unless the source guarantees one row per establishment.
nbhd.geo.json
- Known size: 340,812 bytes; profile reports one top-level JSON object with two keys. The nested feature count is not stated in the profile.
- Apparent subject: GeoJSON neighborhood boundary features. The supplied sample shows a
FeatureCollection; each feature has polygon geometry and properties including an ID, name, borough, counts and shares. - Parsing: loaded as JSON. GeoJSON coordinates are longitude/latitude coordinate pairs. No geometry repair or CRS conversion beyond D3's map projection is applied.
- Missingness: profile reports no missing top-level
typeorfeatures; this says nothing about nested properties. Sampleproperties.typeis null. Feature-level missingness must be evaluated from the actual file.
| Exact field/path | Tentative meaning | Munzner classification |
|---|---|---|
type |
GeoJSON object type, expected to identify a FeatureCollection. | Nominal |
features |
Array of neighborhood GeoJSON features (the profile calls this field a string, but the provided sample establishes nested JSON structure). | Geographic identifiers / structured spatial data |
features[].type |
GeoJSON feature type, typically Feature. |
Nominal |
features[].properties.id |
Neighborhood feature identifier; sample uses values such as N000. |
Geographic identifier |
features[].properties.name |
Neighborhood name. | Geographic identifier |
features[].properties.boro |
Borough name. | Geographic identifier |
features[].properties.type |
Additional feature type; sample is null, semantics unknown. | Nominal |
features[].properties.n_restaurants |
A restaurant count included in the sample; source definition and relationship to the CSV are unverified. | Quantitative |
features[].properties.counts.independent |
Sample count for independent establishments. | Quantitative |
features[].properties.counts.mini_chain |
Sample count for mini-chain establishments. | Quantitative |
features[].properties.counts.chain |
Sample count for chain establishments. | Quantitative |
features[].properties.counts.big_chain |
Sample count for big-chain establishments. | Quantitative |
features[].properties.shares.independent |
Sample proportion/share for independent establishments. | Quantitative |
features[].properties.shares.mini_chain |
Sample proportion/share for mini-chain establishments. | Quantitative |
features[].properties.shares.chain |
Sample proportion/share for chain establishments. | Quantitative |
features[].properties.shares.big_chain |
Sample proportion/share for big-chain establishments. | Quantitative |
features[].geometry.type |
GeoJSON geometry type, such as Polygon. | Nominal |
features[].geometry.coordinates |
Nested coordinate arrays defining polygon rings; GeoJSON order is longitude, latitude. | Geographic coordinates |
The paths listed reflect the nested structure in the supplied sample; actual features may omit properties or use additional properties. geometry is standard GeoJSON structure, not a separately profiled top-level column.
nbhd_stats.json
- Known size: 49,211 bytes; profile reports one top-level object and 195 columns/keys.
- Apparent subject: neighborhood statistics keyed by short NYC-style codes. The JSON object is presented as many code-like keys (
BK88,QN51,MN06, etc.), but the supplied profile does not reveal values or names/definitions of measures. - Parsing: loaded as JSON. The actual nested shape and meaning of each value must be inspected before analysis; no assumptions are made that codes are neighborhood IDs.
- Missingness: the supplied profile marks all 195 keys as nonmissing strings. This is a type inference for the profiled values, not confirmation that all are meaningful measures.
- Fields: all 195 exact keys are listed below. Their tentative meaning is “unidentified key/value in the neighborhood statistics object”; no defensible assignment to a statistic or geography is available from the schema alone.
| Exact key | Tentative meaning | Munzner classification |
|---|---|---|
BK88, QN51, QN27, QN07, MN06, BK25, BX59, QN41, QN08, QN25, QN06, BK44, BK41, BK95, BX33, BK69, QN61, QN01, BX10, QN33, BK43, BK26, BK29, BK72, BK75, BK35, BK79, BK61, BK63, BK96, BX31, BK93, BK91, BK78, BK77, QN20, BK46, BK68, QN68, BX08, BX46, BX55, BK30, BK23, QN19, BX28, QN38, SI99, MN15, QN18, QN26, QN34, QN43, QN21, QN29, QN66, BX62, BX07, BK85, QN55, BK27, BK28, QN30, QN50, QN23, QN37, QN63, BX98, SI12, SI48, BX44, SI28, BK73, BK81, BX52, QN54, QN62, MN27, SI01, MN25, QN17, MN14, MN17, MN40, QN53, SI54, BK60, BX26, BK21, BX22, BX29, BK40, BK64, BX27, BK50, BK42, BK58, QN44, QN45, QN35, QN60, BX09, QN28, BK37, SI11, SI32, MN03, BK82, BK83, MN32, QN48, QN52, BX34, BX39, MN28, BX01, BX35, BX75, MN21, MN01, MN22, MN24, MN13, MN23, MN12, BX43, BX05, BX40, BX41, BX03, BX13, BX06, BX17, BK17, BK19, QN10, QN12, SI08, SI37, QN03, QN05, SI25, SI45, BK90, SI14, SI36, QN15, QN70, BK09, BK38, BK45, BK99, MN50, BX37, BX49, BX99, BK33, BK76, MN20, QN46, BX14, BX63, MN04, MN36, MN35, MN09, MN33, MN19, QN31, MN31, QN71, MN99, QN72, SI07, QN98, QN47, SI05, SI24, MN11, MN34, QN22, QN49, QN02, QN76, BK34, QN42, QN99, BK31, BK32, BX30, BX36, SI35, SI22, QN56, QN57 |
Unidentified per-key value; field meaning and value semantics cannot be inferred safely. | Unclassified pending inspection |
The 195 names are exact keys reported by the authoritative profile. Their string type does not establish whether a value is a category, identifier, date, or numeric quantity.
Defensible relationships and join caveats
- The map relates
restaurants.csv.nbhd_idtonbhd.geo.json.features[].properties.id. This is supported by the sharedN###-style identifiers in the provided examples and can be checked against the runtime values. The visualization uses exact string equality and draws only geometry features with at least one valid-coordinate restaurant record carrying that ID. - The visualization does not join on
nbhd_nameto GeoJSONproperties.name; names can vary in spelling, casing, punctuation or coverage. Borough is not used as a fallback key. - The GeoJSON sample contains precomputed restaurant counts and shares, but their source, date, record grain and category definitions are not established. They are not substituted for counts recomputed from the CSV.
nbhd_stats.jsonkeys look code-like, but no matching key field or encoding is established. Do not join these keys to restaurant neighborhood IDs or GeoJSON feature IDs merely because both look like geographic codes.- Restaurant
camisis an identifier, but its uniqueness and row grain are not verified. Brand location count is a brand-level value repeated across restaurant rows and should not be summed as though it were a per-restaurant quantity. - There are no temporal fields in the supplied restaurant column list, so inspection-time trends cannot be inferred.
Visualization mappings
- Type: neighborhood choropleth map.
- Data:
restaurants.csvandnbhd.geo.json. - Spatial geometry: GeoJSON polygon coordinates projected to a responsive map using D3 Mercator fitting.
- Neighborhood key: exact string match from CSV
nbhd_idto GeoJSON featureproperties.id. - Measure: count of CSV records by neighborhood, after requiring valid latitude/longitude and a nonblank neighborhood ID.
- Color: sequential light-to-dark blue fill, scaled to the largest displayed neighborhood count for the selected tier.
- Filter: dropdown for
tier; “All tiers” is the default. Counts and map fill update with the selection. - Interaction: click or keyboard-activate a polygon to select it and display its name, borough and filtered record count; the close control clears selection. Hover title text and accessible labels expose neighborhood/count context.
- Rationale: a choropleth makes the geographic distribution of neighborhood-level records legible without relying on an unverified join to the statistics object. The measure is explicitly a count of CSV rows, not population-adjusted density or unique establishments.
Files
index.html— page shell and CDN import map.index.jsx— React mount point.App.jsx— runtime dataset loading, validated join, filtering and map rendering.styles.css— responsive layout and accessible visual styling.