npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

d3-radial

v0.0.2

Published

simple radial layout for D3

Downloads

174

Readme

d3-radial

Simple layout for positioning things along a circle or ellipse.

Installing

If you use NPM, npm install d3-radial. Otherwise, download the latest release.

API Reference

Radial

Simple layout for positioning things along a circle or ellipse.

Adds or modifies x and y values of a provided dataset to define location around ellipse.

var radial = d3_radial.radial()
  .center([200, 200]);

svg.selectAll('circle')
  .data(radial(data)).enter()
  .append("circle")
  .attr("cx", function(d) { return d.x; })
  .attr("cy", function(d) { return d.y; })
  .attr("r", 5)
  .attr("fill", "#664466");

# radial.center([center])

If center is specified, sets center position which radial layout radiates from.

Center is expected to be an array with an x and y value.

var radial = d3_radial.radial()
  .center([200, 200]);

If no center is provided, current center of layout is returned.

# radial.size([size])

If size is specified, sets the width and height of ellipse shape. If the width and height are equal, layout positions entities in a circle.

The input size is expected to be an array with an width and height value.

var radial = d3_radial.radial()
  .size([40, 40]);

If no size is provided, current size of layout is returned.

# radial.start(position)

If position is specified, sets the position along the ellipse to start at when placing entities.

Position is expected to be in degrees.

var radial = d3_radial.radial()
  .position(180);

If no position is provided, current starting position of layout is returned.

Spiral

Simple layout for positioning things along a spiral.

Adds or modifies x and y values of a provided dataset to define location around in spiral layout.

Positions start at the center of the spiral and emanate out.

var spiral = d3_radial.spiral()
  .center([200, 200]);

svg.selectAll('circle')
  .data(spiral(data)).enter()
  .append("circle")
  .attr("cx", function(d) { return d.x; })
  .attr("cy", function(d) { return d.y; })
  .attr("r", 5)
  .attr("fill", "#664466");

# spiral.center([center])

If center is specified, sets center position which spiral radiates from.

Center is expected to be an array with an x and y value.

var spiral = d3_radial.spiral()
  .center([200, 200]);

If no center is provided, current center of layout is returned.

# spiral.coil(coil)

If coil is specified, sets the compactness of the spiral. A lower value results in a tighter coil.

var spiral = d3_radial.spiral()
  .coil(40);

If no coil is provided, current coil of layout is returned.

# spiral.increment(increment)

If increment is specified, sets spacing of elements of spiral

var spiral = d3_radial.spiral()
  .increment(10);

If no increment is provided, current increment of layout is returned.