Skip to main content
100%

AI-Generated Colors with D3

✓ Published0🌍 Public
CCurran Kelleher
Last edited Aug 4, 2023
Created on Aug 4, 2023

Three colored boxes display the hex colors #00B8D4, #7ED957, and #FEBD00 in a row. The example demonstrates a minimal D3.js workflow: using `d3.select` on the body, `selectAll('div')` with a data join, and `enter().append('div')` to create boxes styled via `.style('background-color', ...)`. The data array holds the color strings directly, and the styling is applied per datum, showing how D3 maps data to visual elements. The code is generated by ChatGPT and uses D3 v6.

AI-generated description

This code was generated by ChatGPT in response to the prompt:

"Please generate an HTML snippet that will show me these colors as boxes: #00B8D4, #7ED957, and #FEBD00.

and then the following prompt:

Re-write that to use D3.js
MIT Licensed

Similar vizzes