Use d3-annotation with built-in annotation types, or extend it to make custom annotations. It is made for d3-v4 in SVG.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs fix bug with update position Apr 16, 2018
src fix bug with update position Apr 16, 2018
test fix new badge handle dragging Aug 3, 2017
types a few improvements to TS type decl. May 4, 2017
.babelrc polyfill object assign Mar 23, 2017
.eslintrc fix: sending a new list of annotations to an already existing instanc… Jul 9, 2017
.gitignore feat: add updateText functionality May 9, 2017
LICENSE Update LICENSE Mar 22, 2017
README.md fix typo Mar 31, 2017
d3-annotation.independent.js fix bug with update position Apr 16, 2018
d3-annotation.independent.js.map fix bug with update position Apr 16, 2018
d3-annotation.independent.min.js fix bug with update position Apr 16, 2018
d3-annotation.js fix bug with update position Apr 16, 2018
d3-annotation.js.map fix bug with update position Apr 16, 2018
d3-annotation.min.js fix bug with update position Apr 16, 2018
index.js fix npm issues Mar 4, 2017
indexRollup.js fix bug with update position Apr 16, 2018
indexRollup.js.map fix bug with update position Apr 16, 2018
indexRollupNext.js fix bug with update position Apr 16, 2018
indexRollupNext.js.map fix bug with update position Apr 16, 2018
package.json 2.2.5 Apr 16, 2018
rollup.config.js change main to include dependencies Mar 15, 2017
rollupNext.config.js change main to include dependencies Mar 15, 2017
rollupWeb.config.js fix: remove dependencies from web build May 7, 2017
rollupWebIndependent.config.js fix: remove dependencies from web build May 7, 2017
tsconfig.json Add ts typings to lib. Mar 7, 2017

README.md

d3-annotation

Full documentation: http://d3-annotation.susielu.com

Setup

Include the file directly

You must include the d3 library before including the annotation file. Then you can add the compiled js file to your website

Using CDN

You can add the latest version of d3-annotation hosted on cdnjs.

Using NPM

You can add d3-annotation as a node module by running

npm i d3-svg-annotation -S

Feedback

I would love to hear from you about any additional features that would be useful, please say hi on twitter @DataToViz.

Prior art