Set up a D3 envierment

Can anyone recomend me a way so set up a d3 envierment for the d3 projects

1 Like

Sure. In increasing order of difficulty:

  1. Start a new codepen. Then go to the settings, javascript, and search for D3 in the add external scripts box. You just need D3 unless you plan on doing something else.
  2. Edit a html file and add a script tag pointing at D3 on a content delivery network. Searching CDNjs for D3 will give you the appropriate tag.
  3. Set up a local node project and install D3 via npm and either link to the local copy as in #2 or get really creative and use webpack and babel to build a distributable file that includes D3.

Most people should do #1 (or maybe #2 if you want to work locally).

1 Like

add that to your javascript sector in code pen
import d3.js from “https://cdn.skypack.dev/d3