Skip to main content
100%

Shapes with SVGs

✓ Published0🌍 Public
NNehaGawri
Last edited Mar 5, 2021
Created on Mar 4, 2021
Forked from Cars Reports

This example builds a smiling face out of basic SVG shapes, using D3 v6 to generate and style the visualization. A yellow circle serves as the head, with two black circles for eyes and an arc-shaped path for the mouth. The code imports `select` and `arc` from D3, and uses the `arc()` generator to create the mouth’s curved path based on inner and outer radii and angular start/end values. The visualization reads an SVG element from the HTML and positions elements relative to its center.

AI-generated description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.
MIT Licensed

Similar vizzes