Skip to main content
100%

Major Crimes in Boston with Dropdown Menu for Year

✓ Published0🌍 Public
JJosvin John
Last edited Oct 10, 2020
Created on Oct 7, 2020

This interactive visualization displays major crimes in Boston as a bar chart, with the color of each bar representing the year and the bar height showing the crime count per offense category. A dropdown menu allows users to filter the data by selecting one or multiple years. Built with React and Vega-Lite API, the chart loads CSV data via D3’s `csv` function and renders using `vl.markBar()` with `vl.x()` and `vl.y()` encodings. The code includes a custom config for axis styling and uses Vega Tooltip for interactivity.

AI-generated description

The data shown here comes from Boston Crimes Dataset

This chart meant to show the "Major Crimes in Boston". The color denotes the number of occurrences of that crime in that particular year. The drop down allows you to choose the year for which you would like to see Crime Count.

The inspiration for this drop down menu was from https://vizhub.com/pichayutter/88497edd1bcb466997c8d73dc10bf35d

MIT Licensed

Similar vizzes