Massachussetts Top 10 Crime City filter works
✓ Published0🌍 Public
Wwenleicao
Last edited Oct 12, 2019
Created on Oct 11, 2019
This interactive bar chart shows the top 10 cities in Massachusetts by crime rate, with a dropdown menu filtering results by community type (All, City, Rural, or Suburb). The visualization uses React to manage state and render the dropdown, while d3.scaleBand and d3.scaleLinear handle the axes and bar positioning. Crime data comes from a CSV file loaded via d3.csv, with each bar displaying a tooltip showing the exact crime ratio. The y-axis labels are formatted as percentages using d3.format, and the SVG rendering includes gridlines and axis ticks styled with CSS classes.
AI-generated descriptionA 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.
- 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
- tilt the text label so they don't overlap
- 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.
MIT Licensed