Skip to main content
100%

Reusable Scatterplot

✓ Published0🌍 Public
UUVarshaReddy
Last edited Jul 20, 2023
Created on Jul 20, 2023
Forked from Hello VizHub

A reusable scatterplot function visualizes calorie intake against body weight for five individuals, encoding each person as a violet circle with a text label. The chart constructs an SVG renderer using D3 v6, employing `d3.scaleLinear` for both axes and `d3.axisBottom` and `d3.axisLeft` for gridlines. The data is hardcoded as an array of objects with person, weight, and calories fields, and the function accepts both the dataset and a container selector, demonstrating a modular approach to D3 chart creation.

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