{"version":"1.0","type":"rich","title":"d3 update() enter() exit()","description":"This example demonstrates how D3’s data join updates existing DOM elements and adds new ones. The page initially contains three `<p>` elements for dog, cat, and pig. The code binds an array of five numbers to these paragraphs using `d3.select` and `selectAll`, then calls `data()` to get the update set. Using `update.text()`, it rewrites the existing paragraphs with their new values and indices. The `update.enter()` method appends two new `<p>` elements, each filled with the remaining data values via `append` and `text`. The example showcases D3’s declarative enter/update/exit pattern for syncing data to HTML.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/d94d02d5e5ce4bfaa63a7dac606f01ff?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}