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 🙏

© 2026 – Pkg Stats / Ryan Hefner

aleksieiev-planet-diagram

v1.0.6

Published

Simple Vanilla JS lib

Readme

aleksieiev-planet-diagram

Download as package from npm: npm i aleksieiev-planet-diagram

example

To create your planet diagram you simply need to call only 3 functions.

First of all, define a parent for your Planet Diagram and Diagram Description.

Like this const parent = document.getElementsByTagName('body')[0];

Then define the diameter of your Planet Diagram. It will be the main constant for all math executions.

const parent = document.getElementsByTagName('body')[0];

const diameter = 500;

Now you need to create a container for Planet Diagram. There are five necessary arguments:

  1. Planet diameter;
  2. Container Parent(In which block of HTML your Planet Diagram will be pasted, if Parent has not only Planet Diagram as a child, Planet Diagram will be pasted as the last child of the Parent)
  3. Color of shadowed part of your Planet Diagram;
  4. Color of Left(mirrored) side of your diagram;
  5. Color of the right side of your diagram;

*All colors must be in HEX(example: #ffffff)

const parent = document.getElementsByTagName('body')[0];

const diameter = 500; //only numeric value, not strings :)

createPlanetDiagramContainer(diameter, parent, '#dab4b4', '#e9e1e1', '#b3acac');

Then create your description block for diagram, with only one argument for parent(Not necessary to put Planet Diagram and Planet Description in the same Parent, but don't define PlanetDiagramContainer as Parent for the DescriptionContainer.):

const parent = document.getElementsByTagName('body')[0];

const diameter = 500;

createPlanetDiagramContainer(diameter, parent, '#dab4b4', '#e9e1e1', '#b3acac');

createDiscDescriptionContainer(parent);

Now let's create diagram discs for our container. There are six necessary arguments for disc:

  1. Planet Diameter(of Planet Diagram, which you have defined before)
  2. Disc Diameter in relative for Planet Diameter value (from 0 to 0.8, example: 0.56)
  3. Color of the Disc
  4. Id
  5. Diameter of description dots(or Width/Height)
  6. Description text
const parent = document.getElementsByTagName('body')[0];

const diameter = 500;

createPlanetDiagramContainer(diameter, parent, '#dab4b4', '#e9e1e1', '#b3acac');

createDiscDescriptionContainer(parent);

createDisc(diameter, 0.8, '#411fbd', 1, 20, 'text');

createDisc(diameter, 0.75, '#1eb2c5', 2, 20, 'text');

createDisc(diameter, 0.68, 'red', 3, 20, 'text');

createDisc(diameter, 0.5, 'green', 4, 20, 'text');

createDisc(diameter, 0.4, 'blue', 5, 20, 'text');

createDisc(diameter, 0.15, 'yellow', 6, 20, 'text');

You can simply edit the style of your text and dots in disc description; Done!