{"version":"1.0","type":"rich","title":"appending span","description":"This example demonstrates how to append a single text span to a page using D3 v4. The code displays the text \"Edit the code below to change me!\" as a styled span element, with each click of the \"++\" button triggering the update function to re-bind the data. The update function uses `div.selectAll('span')` and `.data([txt])` to manage the selection, then calls `spn.enter().append(\"span\")` to add the element if it does not exist. The span is styled with 50-pixel margins and padding via CSS. The visualization uses a simple data array as its input source and relies on D3's data join pattern.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-ee10bc9f41f1d8d698d305e3a3797789?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}