Skip to main content
Public

Share visualization

Loading preview…

Shapes with SVG and CSS

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Shapes with SVG and CSS

0
Vveagy
Last edited Sep 11, 2018
Created on Sep 11, 2018

This example demonstrates how different SVG shapes—circles, rectangles, lines, and paths—can be styled and combined using D3’s square-root scale and CSS. It shows the same shapes in three group configurations: default styling, explicit fill and stroke attributes, and a group with shared fill/stroke properties. The `d3.scale.sqrt` function is defined but not applied. The SVG uses a `transform` scale, while CSS classes control stroke width, color, and line join/cap styles for the line and path elements.

AI-generated description

An example including some commonly used features of SVG.

Comments

Sign in to join the discussion.

MIT Licensed