Skip to content

Instantly share code, notes, and snippets.

@yangchristian
yangchristian / weightedModulus.js
Created January 7, 2015 22:41
Weighted modulus Angular filter
'use strict';
var _ = _ || require('lodash');
/**
* For an input array, return a multidimensional array with elements distributed
* across rows. Number of elements in each row is determined by a "weighted modulus",
* e.g. keeping a running total based on each elements `dividendProp` and modulo the
* specified `divisor`.
*
@yangchristian
yangchristian / Graph.js
Last active November 24, 2023 00:14
WebGL Network Graph using Three.js
/**
@author David Piegza
Implements a graph structure.
Consists of Graph, Nodes and Edges.
Nodes:
Create a new Node with an id. A node has the properties
id, position and data.