Is your car fuel-efficient? based on selections
This visualization shows the relationship between CO2 emissions and city fuel consumption for different car models, with each point colored by fuel type and tooltips revealing the car make. A brush selection on the plot allows users to filter and highlight specific data points, while panning and zooming are enabled through scale interactions. The visualization is built using the Vega-Lite API and D3.js, with data loaded from a CSV file hosted on GitHub via d3.csv. The code implements a pan/zoom selection bound to scales and a brush selection with union resolution for highlighting.
AI-generated descriptionA visualization constructed using the vega-lite-api.
The data shown here comes from the Kaggle, via [Gist:(https://gist.githubusercontent.com/arjunrao796123/7decbbf770bdb176406f22e8d24069a7/raw/3f990d0e5fdbe269153a0997ff628afc2912bbd6/Fuel_save.csv)].
I referred https://observablehq.com/@vega/vega-lite-composing-selections for the code.
If you use the shift key, you can deselect a region. You can scroll across the screen with the control key.