Canvas Deep Dive

Symbolic cartography using lines

Data Visualization Using Lines, Dashes, Dots & Arrows

by Joe Honton

HTML <canvas> lines

Figures 1 through 4 are drawn using nothing more than HTML <canvas> and JavaScript. See the full article Symbolic cartography using lines for a tutorial with remarks.

Figure 1 Symbolic cartography using lines

Figure 2 Effect of miterLimit on acute angles

Figure 3 Effect of lineCap on dots and dashes

Figure 4 Using overlays to assemble sophisticated lines


Figure 1: An HTML <canvas> with lines representing streets, highways, railroads, power lines, boundaries, rivers, creeks, seasonal watercourses, bike paths, hiking trails, boardwalks, and arrows.

Source code

The JavaScript source code for drawing Figures 1 through 4 onto the canvas. Use these as a starting point for your own creativity.

Symbolic cartography using lines

🔎