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

@icgcat/thematic-stats

v0.0.8-c

Published

Thematic-stats is a library to generate thematic styles for geospatial data visualization

Readme

License Version LinkedIn

@icgcat/thematic-stats

Introduction

@icgcat/thematic-stats is a Node.js package designed for statistical analysis, geospatial data processing, and thematic mapping. It provides utility functions for generating map styles, defining numeric data classifications, and visualizing data for mapping tools. This package is useful for developers, analysts, and GIS professionals handling geospatial datasets and creating thematic visualizations.


Installation

To install the package, use npm or yarn:

npm install @icgcat/thematic-stats

Usage

Import and Basic Example

Here's how to use the stats functions in your application:

<script>

import { generateStyleJSTAT, generateStyle } from '@icgcat/thematic-stats';

// Example 1: Generate a style for thematic mapping
const styleJSTAT = generateStyleJSTAT('population', [10, 20, 30], ['A', 'B', 'C'], false);
console.log(styleJSTAT);

// Example 2: Generate a step-based style
const style = generateStyle('density', [0, 100, 200, 300], ['#FFEDA0', '#FEB24C', '#F03B20']);
console.log(style);


let activeLayer = 'polygonLayerID'
map.setPaintProperty(activeLayer + "-pol", "fill-color", style); 

// or you can import stats from @icgc/stats and: 
// stats.setStyle(capaActiva, currentStyle)


</script>

Component Functions

generateStyleJSTAT(fieldName, arrayData, arrayKeys, geostatObj, forceInt) ⇒ Array

Generates a style configuration for thematic mapping based on GeoStats data.

Kind: global function
Returns: Array - A style configuration array for mapping tools.

| Param | Type | Description | | --- | --- | --- | | fieldName | String | The field name used for matching values. | | arrayData | Array | An array of data values. | | arrayKeys | Array | An array of keys corresponding to the data values. | | geostatObj | Object | The GeoStats object containing data and color mapping. | | forceInt | Boolean | Whether to parse keys as integers. |

Example

const style = generateStyleJSTAT('field', [10, 20], [1, 2], geoStatsObj, true);
console.log(style);

generateStyle(fieldName, arrayValues, arrayColors) ⇒ Array

Generates a step-based style configuration for mapping numeric ranges.

Kind: global function
Returns: Array - A style configuration array for mapping tools.

| Param | Type | Description | | --- | --- | --- | | fieldName | String | The field name used for styling. | | arrayValues | Array | An array of numeric values defining range boundaries. | | arrayColors | Array | An array of colors corresponding to each range. |

Example

const style = generateStyle('field', [10, 20, 30], ['#FF0000', '#00FF00']);
console.log(style);

Developed by:

License

This project is licensed under the MIT License.