Skip to main content
100%

class and id

✓ Published0🌍 Public
MMichaelCalmbach
Last edited Jun 22, 2018
Created on Jun 22, 2018

Two tiny circles demonstrate D3’s selection behavior with the `class` and `id` attributes. The SVG shows one red and one blue circle, each drawn from a hardcoded data array of coordinates. The code uses `d3.select` and `d3.append` with `selectAll('g')` and `selectAll('circle')`, assigning a fixed `class` and `id` to every circle, though only one shape appears visually. The example highlights how D3 groups and styling via `attr('fill')` work, but does not use any data-driven differentiation beyond the two constant color values.

AI-generated description

Built with blockbuilder.org

forked from <a href='http://bl.ocks.org/sxywu/'>sxywu</a>'s block: <a href='http://bl.ocks.org/sxywu/5f023baf745ad1f0fb70a5ec5f68e78e'>class ans id</a>

mit Licensed

Similar vizzes