🌍 Public
Viewing a saved revision (read-only)
8d1b8c3ffee6452ab215454012a185ff
Vizhub Bar Graph
This example shows a horizontal bar chart of Amazon prices across different states, with country names on the y-axis and cost values on the x-axis. The visualization uses React hooks (useState and useEffect) to load CSV data from a GitHub gist, then renders the chart as SVG elements. The code employs d3.csv for data parsing, d3.scaleBand for the categorical y-axis, d3.scaleLinear for the numeric x-axis, and d3.max to determine the domain. A red gridline is drawn at each x-axis tick value, with the most recently imported year’s data shown.
AI-generated descriptionA whole smiley face