Skip to main content
šŸŒ Public

Share visualization

Send this visualization to others.

SVG with CSS

Public visualization

Viewing a saved revision (read-only)

d8141f72a13f40489f7e88a4ea0fd9a1

SVG with CSS

0 stars0šŸŒ Public
Mmomer99
Last edited Sep 18, 2023
Created on Sep 18, 2023
Forked from D3 Starter

This example demonstrates how to combine SVG shapes with CSS styling and D3.js version 7. It shows circles, rectangles, lines, and paths rendered in an SVG canvas, with CSS classes controlling stroke properties like color and width. The code uses d3.select to insert text into the page, while the SVG elements themselves rely on standard SVG attributes for positioning and fills. A second SVG contains a single line element with inline stroke styling. The example highlights how CSS can be applied to SVG elements through class selectors.

AI-generated description

A demonstration of how to start using D3 version 6.