d3v4 - Switchable Table
✓ Published0🌍 Public
HHirosaji
Last edited Feb 19, 2020
Created on Jul 14, 2018
A switchable table visualizes monthly job and industry category data, allowing users to toggle between two datasets via buttons labeled 職種別 and 業種別. The table initially sorts by a default month column and supports interactive re-sorting by clicking any header, which highlights the active column in red. Built with d3.v4, the example uses `d3.queue` and `d3.tsv` to load both tab-separated files, then dynamically appends an HTML table via `d3.select` and handles data binding with `enter()` and `merge()`. Sorting is implemented by comparing string values on the selected header, and header classes are updated with `classed` to reflect the chosen sort key.
AI-generated description