Skip to main content
100%

Massachussetts Top 10 Crime City filter works

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

This interactive bar chart displays the crime rates of Massachusetts cities, filterable by community type (All, City, Rural, Suburb) via a dropdown menu. Built with React and D3 v5, it renders an SVG visualization where each bar shows the crime rate as a percentage. The chart loads data from a CSV file containing 2016 crime statistics, using D3's `csv`, `scaleBand`, `scaleLinear`, and `format` functions for data processing and axis scaling. The top 10 cities are displayed by default, with tooltips revealing precise percentage values.

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