Skip to main content
100%

SF Monthly Property Crimes 2005 to 2015

✓ Published0🌍 Public
TThanaporn-sk
Last edited May 12, 2017
Created on May 12, 2017

A heatmap visualizes monthly property crime counts in San Francisco from 2005 to 2015, with months on the x-axis and years on the y-axis, colored by total incident frequency using `d3.scaleSequential` with the Viridis interpolator. The code processes a CSV dataset via `d3.csv`, `d3.timeParse`, and `d3.nest()` to aggregate incidents by year and month, then renders SVG rectangles for each cell. A color legend is drawn using `d3.axisBottom` and a linear gradient, while axes use `d3.axisBottom` and `d3.axisLeft`. The data originates from San Francisco’s open data portal.

AI-generated description

SF Monthly Property Crimes 2005 to 2015

This example demonstrates how to use a heatmap to show time series data. The actual heatmap visualization is not difficult to generate---more time in this example is spent on preparing the data using d3.nest() and on creating the color legend.

Warning

This data is not adjusted for changes in population, and this spans enough time that what we could really be seeing is a change in population and not a change in crime.

We might be able to fix that using these numbers:

But, this is not yet fixed in this example.

Data Source

You can access the dataset for this example directly at:

https://data.sfgov.org/Public-Safety/Monthly-Property-Crime-2005-to-2015/k5vw-3yuz

The dataset is derived from the SFPD Incidents - from 1 January 2003 dataset available at data.sfgov.org.

forked from <a href='http://bl.ocks.org/sjengle/'>sjengle</a>'s block: <a href='http://bl.ocks.org/sjengle/24aa9dc777bfc295a9e7'>SF Monthly Property Crime 2005 to 2015</a>

mit Licensed

Similar vizzes