Massachusetts Crime Dataset
This example displays the size and structure of the Massachusetts Crime Dataset, showing the file size in kilobytes, the number of rows, and the number of columns. It loads the CSV from a GitHub gist using D3 v5’s `d3.csv` method, which parses the data into an array of objects. The code then uses `d3.csvFormat` to re-serialize the data for size calculation and accesses the `length` and `columns` properties to count rows and fields. The resulting information is rendered into a large `<pre>` element using plain text manipulation via the Document Object Model.
AI-generated descriptionCrime Known to Law Enforcement, by State by City, 2016 https://gist.githubusercontent.com/wenleicao/24da06aff2538ba8740e559c7e670257/raw/dcfc42aadebb5e41fc788529b9e458f95ae27ca6/Massachussetts_Crime.csv
The FBI collects these data through the Uniform Crime Reporting (UCR) Program.
This table provides the volume of violent crime (murder and nonnegligent manslaughter, rape, robbery, and aggravated assault) and property crime (burglary, larceny-theft, and motor vehicle theft) as reported by city and town law enforcement agencies (listed alphabetically by state) that contributed data to the UCR Program. (Note: Arson is not included in the property crime total in this table; however, if complete arson data were provided, it will appear in the arson column.)
columns Population Violent crime Murder and nonnegligent Rape Robbery Aggravated assault Property crime Burglary Larceny- theft Motor vehicle Arson