Skip to main content
100%

분기별 유동인구, 매출

✓ Published0🌍 Public
Ssuji8073
Last edited May 19, 2021
Created on May 19, 2021

An interactive bar chart comparing quarterly foot traffic and sales across Seoul districts. A dropdown menu, generated from the data fields using a data join, lets viewers switch the y-axis variable, triggering a selection change that updates both the bar positions and the d3.axisLeft scale. The visualization loads survey data via d3.json, prepares nested aggregates with d3.nest and d3.mean, and renders the dynamic bars with SVG rectangles, applying the general update pattern to adjust attributes in place.

AI-generated description

Interactive bar chart example

In this visualization, the data that's rendered in the view changes because of user interaction

Steps

  • Find good example of update loop
  • Write a concept that uses interaction (changing scales?)
  • Set up basic chart
  • Set up interacion
  • Make x-axis interactive so remove and enter are also needed

Concept

A chart showing distribution or relation between to variables. The vriables can be chosen through a dropdown menu resulting in a rerendering of datapoints and axis.

  • Group students by subject interest on x axis.
  • Get data from different vars on y axis

Notes

  • Note that d3 has a new way of handling enter, update and exit explicitly as explained in this article.
  • The options in the form are generated from the data using a data join
  • The scales, the data and the selected opton are global. I found that to be nicer than to keep passing them everywhere
  • If you want to add a new option to this interactive graph, all you have to do is add a new computed variable in the prepareData module and everything else will happen automatic

Inspiration

MIT Licensed

Similar vizzes