All Projects → algebraic-graphs → Typescript

algebraic-graphs / Typescript

Licence: mit
Algebraic graphs implementation in TypeScript

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Typescript

Unity Easinglibraryvisualisation
Front end visualisation of 40 common easing equations.
Stars: ✭ 178 (+66.36%)
Mutual labels:  graph, graphs
agda
The theory of algebraic graphs formalised in Agda
Stars: ✭ 67 (-37.38%)
Mutual labels:  algebra, graph
Swiftcharts
Easy to use and highly customizable charts library for iOS
Stars: ✭ 2,336 (+2083.18%)
Mutual labels:  graph, graphs
Alga Paper
A minimalistic, elegant and powerful approach to working with graphs in a functional programming language
Stars: ✭ 163 (+52.34%)
Mutual labels:  graph, algebra
Uplot
📈 A small, fast chart for time series, lines, areas, ohlc & bars
Stars: ✭ 6,808 (+6262.62%)
Mutual labels:  graph, graphs
Litegraph.js
A graph node engine and editor written in Javascript similar to PD or UDK Blueprints, comes with its own editor in HTML5 Canvas2D. The engine can run client side or server side using Node. It allows to export graphs as JSONs to be included in applications independently.
Stars: ✭ 2,735 (+2456.07%)
Mutual labels:  graph, graphs
Squid
A Ruby library to plot charts in PDF files
Stars: ✭ 205 (+91.59%)
Mutual labels:  graph, graphs
Kglib
Grakn Knowledge Graph Library (ML R&D)
Stars: ✭ 405 (+278.5%)
Mutual labels:  graph, graphs
Alga
Algebraic graphs
Stars: ✭ 619 (+478.5%)
Mutual labels:  graph, algebra
Quickqanava
C++14 network/graph visualization library / Qt node editor.
Stars: ✭ 611 (+471.03%)
Mutual labels:  graph, graphs
Ingraph
Incremental view maintenance for openCypher graph queries.
Stars: ✭ 40 (-62.62%)
Mutual labels:  graph, graphs
Leaderboardx
A tool for building graphs quickly
Stars: ✭ 13 (-87.85%)
Mutual labels:  graph, graphs
Graphmat
GraphMat graph analytics framework
Stars: ✭ 81 (-24.3%)
Mutual labels:  graph, graphs
Node Sonic Channel
🦉 Sonic Channel integration for Node. Used in pair with Sonic, the fast, lightweight and schema-less search backend.
Stars: ✭ 101 (-5.61%)
Mutual labels:  graph
Rdflib
RDFLib is a Python library for working with RDF, a simple yet powerful language for representing information.
Stars: ✭ 1,584 (+1380.37%)
Mutual labels:  graph
Pygraphistry
PyGraphistry is a Python library to quickly load, shape, embed, and explore big graphs with the GPU-accelerated Graphistry visual graph analyzer
Stars: ✭ 1,365 (+1175.7%)
Mutual labels:  graph
Online place recognition
Graph-based image sequences matching for the visual place recognition in changing environments.
Stars: ✭ 100 (-6.54%)
Mutual labels:  graph
Workbase
Grakn Workbase (Knowledge IDE)
Stars: ✭ 106 (-0.93%)
Mutual labels:  graph
Clj Xchart
XChart wrapper for Clojure
Stars: ✭ 105 (-1.87%)
Mutual labels:  graph
Graph sampling
Graph Sampling is a python package containing various approaches which samples the original graph according to different sample sizes.
Stars: ✭ 99 (-7.48%)
Mutual labels:  graphs

Algebraic graphs implementation in TypeScript

npm Build Status

alga-ts is a library for algebraic construction and manipulation of graphs in TypeScript. This is a TypeScript port of alga and alga-scala.

See this Haskell Symposium paper and the corresponding talk for the motivation behind the library, the underlying theory and implementation details. There is also a Haskell eXchange talk, and a tutorial by Alexandre Moine.

N.B. Please note that this project is WIP, so use it at your own discretion.

Installation

The main library, alga-ts, is available at the NPM. As it uses fp-ts for higher-kinded types, be sure to install it as well:

npm install --save alga-ts fp-ts

Usage

To begin using alga-ts, you first need to obtain an instance of it's API for the given Eq of your target data type. Consider the example:

import { getStructEq, eqNumber, eqString } from 'fp-ts/lib/Eq';
import { getInstanceFor } from 'alga-ts';

interface User {
  name: string;
  age: number;
}

const eqUser = getStructEq({
  name: eqString,
  age: eqNumber,
});

const G = getInstanceFor(eqUser);

Now G is a module containing all methods & constructors required to work with graphs of User:

const user1: User = { name: 'Alice', age: 32 };
const user2: User = { name: 'Bob', age: 41 };
const user3: User = { name: 'Charlie', age: 28 };

const graph1 = G.connect(
  G.edge(user1, user2),
  G.edge(user2, user3),
);

console.log(G.hasEdge(user1, user3, graph1)); // => true

Pipeable graphs

Algbraic graphs happen to have type class instances for Monad (and, consequently, for Functor and Applicative) and Alternative. API instance, obtained via getInstanceFor, exposes methods from these type classes in a data-last form, so they could be used with pipe from fp-ts:

import { pipe } from 'fp-ts/lib/pipeable';
import { getInstanceFor } from 'alga-ts';

const GS = getInstanceFor(eqString);

...

const graph2 = pipe(
  graph1,
  G.map(u => u.name),
);

console.log(GS.hasEdge('Alice', 'Charlie', graph2)); // => true
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].