RepositoryJavaScript
saehm

saehm/DruidJS

A JavaScript Library for Dimensionality Reduction

128stars
13forks
8issues
2views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: unsupervised-learning

#1 Repository of the month

1
TINIX TRENDING·Topic: clustering

#1 Repository of the month

1
TINIX TRENDING·Topic: dimensionality-reduction

#1 Repository of the month

DruidJS — A JavaScript Library for Dimensionality Reduction.

DruidJS is a JavaScript library for dimensionality reduction. With dimesionality reduction you can project high-dimensional data to a lower dimensionality while keeping method-specific properties of the data. DruidJS makes it easy to project a dataset with the implemented dimensionality reduction methods.


Codecov NPM Downloads GitHub Actions Workflow Status License DOI:10.1109/VIS47514.2020.00029

Resources

@inproceedings{cutura2020druid,
  title={{DRUIDJS — A JavaScript Library for Dimensionality Reduction}},
  author={Cutura, Rene and Kralj, Christoph and Sedlmair, Michael},
  booktitle={2020 IEEE Visualization Conference (VIS)},
  pages={111--115},
  year={2020},
  organization={IEEE}
}

Installation

If you use npm, install with npm install @saehrimnir/druidjs, and use it with

import * as druid from "@saehrimnir/druidjs";

Otherwise download the files here, or use for instance unpkg this way:

Matrix

DruidJS uses internally the Matrix class for storing data. You can use it by creating a druid.Matrix object for instance with the function from, in example:

import * as druid from '@saehrimnir/druidjs';

let data = [[...], [...], ...];
let matrix = druid.Matrix.from(data);

You can create a druid.Matrix object programmatically by:

let fn = (row, col) => (row == col ? 1 : 0);
let matrix = new druid.Matrix(rows, columns, fn);

If rows == columns, then matrix would be a identity matrix. A shortcut for a identity matrix is:

let matrix = new druid.Matrix(rows, columns, "I");
// or
let matrix = new druid.Matrix(rows, columnbs, "identity");

There are more shortcuts for creating matrices:

let matrix = new druid.Matrix(3, 3, "zeros"); // matrix would be a 3x3 matrix with zeroes
let matrix = new druid.Matrix(3, 3, "center"); // matrix would be a 3x3 center matrix;
let number = 12;
let matrix = new druid.Matrix(3, 3, number); // matrix would b a 3x3 matrix filled with 'number'

If you want to use a druid.Matrix object, for instance, with d3, you can use either the to2dArray property, the iterate_rows generator function, or just use the druid.Matrix object as an iterable (works with d3 since version 6).

let data = await d3.csv("data.csv");
let matrix = druid.Matrix.from(data);
d3.selectAll("datapoints").data(matrix.to2dArray); //...
d3.selectAll("datapoints").data(matrix.iterate_rows()); //...
d3.selectAll("datapoints").data(matrix); //...

DR methods

Transform

Example

Generator

Example

TopoMap Example

Example ...

Similar Projects

Discover other similar projects and AI models.

RepositoryPython
JustGlowing/minisom

:red_circle: MiniSom is a minimalistic implementation of the Self Organizing Maps

1.6k
Oct 19, 2026
RepositoryJulia
JuliaStats/MultivariateStats.jl

A Julia package for multivariate statistics and data analysis (e.g. dimension reduction)

387
Sep 15, 2026
RepositoryR
jlmelville/smallvis

R package for dimensionality reduction of small datasets

73
Nov 12, 2026
RepositoryPython
lmcinnes/umap

Uniform Manifold Approximation and Projection

8.3k
Dec 2, 2026
Repository
seandavi/awesome-single-cell

Community-curated list of software packages and data resources for single-cell, including RNA-seq, ATAC-seq, etc.

3.9k
Dec 1, 2026
RepositoryPython
benedekrozemberczki/awesome-community-detection

A curated list of community detection research papers with implementations.

2.5k
Dec 20, 2025
RepositoryJupyter Notebook
jmartinezheras/2018-MachineLearning-Lectures-ESA

Machine Learning Lectures at the European Space Agency (ESA) in 2018

381
Sep 18, 2023
RepositoryR
jlmelville/uwot

An R package implementing the UMAP dimensionality reduction method.

371
Nov 23, 2026
RepositoryPython
GAA-UAM/scikit-fda

Functional Data Analysis Python package

358
Nov 20, 2026