Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Shapes and Colors with SVG and CSS

Public visualization

Viewing a saved revision (read-only)

e334a931134845f7a21364db6b7267f8

Shapes and Colors with SVG and CSS

0 stars0🌍 Public
RRob Foggo
Last edited Sep 3, 2019
Created on Sep 3, 2019

This example demonstrates basic SVG rendering with D3, showing a red background applied to an SVG canvas. The code selects the `svg` element using `d3.select` and sets its background color through the style method, while the body has hidden overflow and no margin. It includes a static SVG container sized at 960 by 500 pixels, with a linked stylesheet for CSS styling. The example uses D3 v5 and the SVG rendering approach, serving as a minimal introduction to combining SVG elements with D3 selections and CSS for visual customization.

AI-generated description

An example including some commonly used features of SVG.