Live Server is a VS Code extension that provides a local web server for project files. It lets browser-based D3 projects load JavaScript and data files in an environment where opening HTML files directly can trigger security errors. section 2.2
Use Live Server to prepare a simple local D3 workspace:
- Install VS Code if needed, then install the Live Server extension. section 2.2
- Open the project containing the HTML, JavaScript, and data files. section 2.2
- Start the local server through the extension before running the project in a browser, and stop it when finished. section 2.2
A D3 project that loads data
Opening an HTML file directly may appear to work for simple pages, but a D3 visualization that loads a data file needs to run through a web server. Live Server supplies that local development server from VS Code. section 2.2
