{"version":"1.0","type":"rich","title":"D3.js selection.exit() Function","description":"This example demonstrates how D3.js’s `selection.exit()` function removes DOM elements that no longer have corresponding data after a data update. The code initially creates green `<div>` elements for three data items (“geeks”, “for”, “geeks”) using `d3.selectAll(\"div\").data(...).enter().append()`. It then binds a new four-item dataset (`\"DIVS UPDATED\"`, `\"GEEKS\"`, `\"FOR\"`, `\"GEEKS\"`) with a key function, appends new divs for entering data, and calls `div.exit().remove()` to delete the old divs whose keys are missing from the updated dataset. The page uses D3 v4 from the official CDN, with styling defined in a `<style>` block.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/2fa4da0d974d4cea8e1c805bf4c24c52?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}