npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

d3-radial-axis

1.6.2 • Public • Published

d3-radial-axis

NPM package Build Size Dependencies

A radial implementation of the D3 axis component.

To use for instance in a clock or a gauge meter.

Quick start

import { d3AxisRadialInner, d3AxisRadialOuter } from 'd3-radial-axis';

or

var d3.radialAxis = require('d3-radial-axis');

or even

<script src="/path/to/dist/d3-radial-axis.js"></script>

then

var myAngleScale = d3.scaleLinear()
    .domain([-10, 10])
    .range([-Math.PI, Math.PI]);
var myRadius = 100;
var myRadialAxis = d3.axisRadialInner(myAngleScale, myRadius);

d3.select(<myDOMElement>).call(myRadialAxis);

API reference

Same features as the regular D3 axis.

d3.axisRadialOuter()
    .ticks()
    .tickArguments()
    .tickValues()
    .tickFormat()
    .tickSize()
    .tickSizeInner()
    .tickSizeOuter()
    .tickPadding()

Includes additional properties to configure the radial axis, the angleScale, and the axis radius.

Also supports the representation of a spiral axis when setting a pair of startRadius and endRadius.

d3.axisRadialOuter()
    .angleScale()
    .radius()
    .startRadius()
    .endRadius()

install

npm i d3-radial-axis

Downloadsweekly downloads

820

version

1.6.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability