I have been trying to reproduce this ObservableHQ code on collapsible tree into regular html-css-js format. Below is my implementation.