Skip to main content
100%

Massachussetts Top 10 Crime City by Crime Count/Population

✓ Published0🌍 Public
Wwenleicao
Last edited Oct 1, 2019
Created on Oct 1, 2019

This interactive bar chart visualizes the top 10 Massachusetts cities by crime count relative to population. Built with React and D3 v5, it renders an SVG that displays the crime ratio as a percentage on the y-axis, with city names along the x-axis. The visualization utilizes `scaleBand` and `scaleLinear` for coordinate mapping, while `csv` loads the 2016 crime dataset from a GitHub gist. Hovering over each bar reveals the exact crime ratio via a `title` tooltip, filtering the data to rural communities.

AI-generated description

A program that shows the top 10 most crime city in massachusetts

I have tried my best to adjust the chart. there are a few things I cannot figure out still.

  1. adjst the Y axis, so that 0.0% line line with bottom of column. column value appear correct though. wrap my head, not sure why
  2. tilt the text label so they don't overlap
  3. I was able to refactor useData.js, but not other module. There is a tick() is not a function error I don't have solution.

Data: Masschusetts Crime dataset for 2016.

MIT Licensed

Similar vizzes