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
KKelseyXu5
Last edited Jan 14, 2022
Created on Jan 14, 2022
Forked from HTML Starter

This example demonstrates how to combine SVG shapes with CSS styling to create a simple interactive visualization. It shows a red-background SVG canvas with geometric elements styled through custom CSS classes, including highlighted shapes and line properties. The code uses D3 v7 for SVG selection and attribute manipulation, specifically the `d3.select` method to target the SVG element and apply the background color. The visualization includes CSS-defined classes for line styling, such as stroke color and width, and path-specific properties like stroke-linejoin. Built as a React application, the example renders through standard SVG markup within an HTML page.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

Comments

Sign in to join the discussion.

MIT Licensed