{"version":"1.0","type":"rich","title":"practice8--update pattern","description":"This example demonstrates the D3.js “update” pattern for animating changes to a data-driven visualization, using a fruit bowl of apples and lemons. The code uses `selection.selectAll().data()` with the `.enter()`, `.merge()`, and `.exit()` methods to handle newly added, updated, and removed circles, respectively. Animations are applied through `.transition().duration(1000)` to smoothly adjust circle radii and positions over time. The example uses `scaleOrdinal` for color and radius mapping, with a fixed SVG viewport and a `render()` function called at intervals to trigger updates such as eating, replacing, or filtering fruits.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/42596e72bb7d4a3dab133e41f32e7860?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}