Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Shapes and Colors with SVG and CSS

Public visualization

Shapes and Colors with SVG and CSS

0 stars0🌍 Public
Rroxannekim
Last edited Apr 7, 2020
Created on Apr 7, 2020

This example demonstrates how SVG shapes can be styled and colored using both SVG attributes and CSS rules. The visualization renders a blank red SVG canvas, with CSS classes defining stroke properties for line elements and paths, including a custom teal color for path strokes with rounded joins and caps. The code uses d3.select to target the SVG element and applies an inline background color, while the stylesheet imports D3 v5 from a CDN. The rendering approach relies entirely on SVG's built-in shape and styling capabilities rather than data-driven generation.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed