All examples By author By category About

micahstubbs

Canvas Links + SVG Nodes

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