Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Shapes with SVG and CSS

Public visualization

Shapes with SVG and CSS

0 stars0🌍 Public
Ii202081
Last edited Mar 26, 2020
Created on Mar 24, 2020

This example demonstrates how SVG shapes can be styled using CSS within a D3.js visualization. It renders a single, empty SVG element with a fixed width and height, whose background color is set to red via D3’s selection and style method. The page also applies global CSS rules to remove margins and hide scrollbars, ensuring the SVG fills the viewport without distraction. The code relies on D3 v5 for DOM selection and styling, while the overall structure uses standard HTML and CSS.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed