block by micahstubbs 5246b8a643393f0753a11b98129a3237

Canvas Links + SVG Nodes

Full Screen

a now-successful attempt to draw links with canvas paths so that the end of each link overlaps perfectly with the center of an svg circle we use to represent a node.

thanks to @enjalot for pointing out that the CSS body { margin: 0; } would do the trick.


a clue: somehow the canvas links layer lines up nicely with the svg nodes layer in the iframe on bl.ocks.org but doesn’t at all when it’s all by itself on the page 🤔

a fork of Blocks Graph I Readme Mentions

a simpler example of this canvas for links, svg for nodes network drawing technique is the bl.ock Ch. 11, Fig. 10 - D3.js in Action from emeeks

index.html

jsLouvain.js