learning d3 lines
✓ Published0🌍 Public
Aamundo
Last edited Sep 26, 2015
Created on Sep 26, 2015
A text area accepts typed integer pairs, and each line of input becomes a point in a two-dimensional path rendered as an SVG line graph on a dark background. The visualization updates live on every keystroke, using D3’s `d3.svg.line` to map coordinates and appending a `path` element to the SVG canvas. The code also displays the raw SVG `d` attribute of the generated path in a paragraph below, making the underlying vector data visible. Data is parsed from whitespace-separated integers in the textarea, and the path is redrawn from scratch on each input event.
AI-generated descriptionPlaying with lines
Type two integers per line in the text area, and a line will be drawn on the right.