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 🙏

© 2025 – Pkg Stats / Ryan Hefner

atlas4

v1.0.2

Published

atlas4 library for web network topology maps

Downloads

1

Readme

Atlas4

A network map creating/editing library

Dev Setup

Run npm install to install package dependencies

npm install

And npm run build to create a build version of atlas4

npm run build

Create an Atlas Project directory and copy the library into the project folder. Eg.

mkdir -p ./Atlas4\ Project
mv lib ./Atlas4\ Project

Usage

Directory Structure

Atlas4 Project
├── index.html
├── js
│   ├── options.js
│   └── script.js
└── lib
    ├── 2273e3d8ad9264b7daa5bdbf8e6b47f8.png
    ├── 4f0283c6ce28e888000e978e537a6a56.png
    ├── Atlas4.js
    ├── Atlas4.js.map
    └── a6137456ed160d7606981aa57c559898.png

HTML

<!DOCTYPE  html>
<html  lang="en">
<head>
	<meta  charset="UTF-8">
	<meta  name="viewport"  content="width=device-width, initial-scale=1.0">
	<meta  http-equiv="X-UA-Compatible"  content="ie=edge">
	<title>Atlas4</title>
</head>
<body>
	<div  id="map-container"></div>

	<script  src="lib/Atlas4.js"></script>
	<script  src="js/options.js"></script>
	<script  src="js/script.js"></script>
</body>
</html>

Options.js

The Options.js file lets you define the default values when creating the map. Here are all the options that can be defined.

let  lineHtml  =  `HTML Text to define custom tooltip when hovering over a circuit`
let  pointHtml  =  `HTML Text to define custom tooltip when hovering over a point`

const  mapOptions  = {
	debug:  true,
	controls: {
		allLayers:  false,
		zoomMin:  false,
		editor:  false,
	},
};

const  legendOptions  = {
	position:  'bottom-left',
	orientation:  'vertical',
	size:  '100%',
	legends: {
		lines: {
			type:  'percent',
			units:  'bps',
			min:  0,
			max:  100,
			thresholds: [1.9, 3.2, 4.9, 7.4, 11, 16.1, 23.3, 33.6, 48.3, 69.2, 99],
			colors: ['#77BEFC', '#37A1FB', '#A2FEAF', '#76F588', '#2BE690', '#FFE13B', '#F2D236', '#F2A82A', '#FF5459', '#F20544', '#E846A5', '#bf70f9']
		},
	}
};

// Leaflet Options
// See https://leafletjs.com/reference-1.7.1.html#map-option
const  leafletOptions  = {
	minZoom:  2,
	maxZoom:  20,
	attributionControl:  false,
	zoomControl:  true,
	zoomSnap:  0.5,
	zoomDelta:  1,
	boxZoom:  true,
	doubleClickZoom:  true,
	dragging:  true,
	scrollWheelZoom:  true,
	updateWhenZooming:  false,
	updateWhenIdle:  true,
};

  
// Map Tiles
// Define more than one tiles to switch between programatically
const  tileOptions  = [
	{
		url:  'https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png',
		token:  'Map_Tile_Access_Token',
		maxZoom:  20,
		default:  true,
		name:  'map'
	},
	{
		url:  'https://api.mapbox.com/styles/v1/mapbox/satellite-v8/tiles/{z}/{x}/{y}',
		token:  'Map_Tile_Access_Token',
		maxZoom:  20,
		name:  'satellite'
	}
]
  
// LEGACY, This option will be removed in a future release
// Still needed right now
const  topologyOptions  = {
	twins:  false,
};

  

const  pointOptions  = {
	size:  3,
	shape:  'circle',
	color:  'rgba(40, 40, 40, 1)',
	stroke:  1,
	fill:  'rgba(40, 40, 40, 1)',
	fillOpacity:  1,
	staticTooltip:  true
}

  

const  lineOptions  = {
	dataTarget:  'input.now',
	weight:  3,
	opacity:  1,
	smoothFactor:  1,
	color:  'rgba(120,120,120,0.5)',
};

  

const  tooltipOptions  = {
	autoPan:  false,
	line: {
		html:  lineHtml,
	},
	point: {
		html:  pointHtml,
	}
}

  

let  atlasOptions  = {
	map:  mapOptions,
	legend:  legendOptions,
	leaflet:  leafletOptions,
	tiles:  tileOptions,
	topology:  topologyOptions,
	point:  pointOptions,
	line:  lineOptions,
	tooltip:  tooltipOptions,
	overlayTiles:  overlayTileOptions,
	overlayTopology:  overlayTopologyOptions
};

Script.js

The Script.js file will be used to initialize the Atlas4 Object

let atlas  =  new  Atlas('map-container', atlasOptions);

// Add Topology
let network = {
    name: "Atlas4 Network",
    endpoints: {
        "100": {
            "id": "100",
            "label": "Endpoint 1",
            "lat": 42.345,
            "lng": -96.167448,
        },
        "101": {
            "id": "101",
            "label": "Endpoint 2",
            "lat": 22.669533,
            "lng": -86.25606,
        }
    },
    adjacencies: [
        {
            "a": "100",
            "b": "101",
            "id": "581223"
        }	
    ]
}

atlas.addTopology(network)