d3-arrows

1.1.1 • Public • Published

npm

d3-arrows

Helper functions for making curved labels for d3 svg graphics

Installing

If you use NPM, npm install d3-arrows

Usage

d3-arrows exports a function called addLabel. This takes a single argument which is an object with all your label options. el should be a d3 selector for the element you want to add the label to. Currently only one type of arrow is supported, the arc.

The radius, largeArcFlag and sweepFlag properties are optional.

Example use:

addLabel({"el":svg,
	"id":"denison",
	"targetX":projection([151.2,-33.9])[0],
	"targetY":projection([151.2,-33.9])[1],
	"sourceX":projection([154.21,-36.09])[0],
	"sourceY":projection([154.21,-36.09])[1],
	"text":"Fort Denison"
});

A label for Fort Denison in Sydney

Readme

Keywords

Package Sidebar

Install

npm i d3-arrows

Weekly Downloads

2

Version

1.1.1

License

MIT

Unpacked Size

95.2 kB

Total Files

6

Last publish

Collaborators

  • nickevershed