Fork of Data Visualization Homework 8: Sankey Diagram
✓ Published0🌍 Public
Jjerry70938@gmail.com
Last edited Nov 1, 2024
Created on Oct 29, 2024
Forked from Data Visualization Homework 8: Sankey
Diagram
This Sankey diagram visualizes car evaluation data, showing the flow of categorical attributes (buying price, maintenance cost, doors, persons, luggage boot, safety) into the final car acceptability rating. The diagram uses D3.js v5 to render nodes and links as an SVG, where node width represents the value of each category, and link thickness indicates the quantity of cars flowing between categories. The code defines a custom `flowDiagram` module with methods like `nodeWidth`, `nodePadding`, and `layout` to manage the diagram’s geometry, while a cubic Bézier curve function draws the links. The data is loaded from the `car.data` file, which contains comma-separated rows that are parsed into nodes and links.
AI-generated descriptionMIT Licensed