{"version":"1.0","type":"rich","title":"Drawing SVG rect with D3","description":"This example demonstrates two ways to render a blue SVG rectangle: one statically defined directly in HTML markup, and another generated dynamically using D3’s selection and data-join methods. The code uses `d3.select` to append an `svg` element to the body, then chains an `append('rect')` call to set its width and height attributes via `.attr()` and its fill color via `.style()`. A hand-written `<rect>` element appears above as a visual comparison, while the D3-generated rectangle is rendered below, with both sharing the same dimensions and color.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/3db115da6703457bafd402ce1ed4bb35?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}