Skip to content

@fkling fkling released this May 13, 2015 · 17 commits to master since this release

New

API/Algorithms

  • eigenvectorCentrality (genEigenvectorCentrality)
Assets 2

@fkling fkling released this Apr 23, 2015 · 21 commits to master since this release

New

API/Algorithms

Weighted and generic shortest path algorithms. The "generic" functions provide
a single interface for weighted and unweighted algorithms.

  • allPairsDijkstraPath
  • allPairsDijkstraPathLength
  • dijkstraPath
  • dijkstraPathLength
  • singleSourceDijkstra
  • singleSourceDijkstraPath
  • singleSourceDijkstraPathLength
  • shortestPath
  • shortestPathLength
  • hasPath

including async (gen*) versions.

Assets 2

@fkling fkling released this Apr 11, 2015 · 29 commits to master since this release

New

API

  • Many algorithms are now available as asynchronous methods. E.g. clustering
    is available as genClustering. Those methods return a Promise and will
    delegate to a web worker in browsers. In Node.js, a new process will be
    spawned.
    Note that in both cases the data has to be serialized, which happens
    synchronously and may also take some time, depending on the size of the
    graph.

Drawing

  • New drawing option stickyDrag. If set to true, the dragged node will keep
    its new position after dragging and is not subject to the force layout.
    D3 example.

Changes

API

  • Moved from underscore_method_names to camelCaseMethodNames.
  • makeSmallUndirectedGraph and makeSmallGraph now accept an object of the form
    {type, name, n, list} as first argument instead of an array [type, name, n, list].
  • Objects are not considered as "NodeContainers" anymore. Previously, any function
    that accepted a list of nodes also accepted an object of the form
    {n1: ..., n2: ..., ...} and n1, n2, ... would have been treated as nodes.
    Instead, any object that implements the ES6 iterator protocol
    can be used.
    This includes (by default) arrays and generator functions.
  • Graph classes cannot be instantiated without new anymore. I.e. you have to use
    var G = new jsnx.Graph(); instead of var G = jsnx.Graph();. That's because
    ES6 classes cannot be called without new.
  • The utility methods cumulative_sum, generate_unique_node and
    is_list_of_ints have been removed, since there was no need for them.

Algorithms

  • balancedTree doesn't set the height to 2 anymore if the branching factor is
    1. So balancedTree(1, 4) is equivalent to pathGraph(4).

Drawing

  • Like with method names, drawing options are camelCase now instead of
    under_score.

Fixed

Drawing

  • Fixed dragging (canvas doesn't pan while node is dragged).
Assets 2
Sep 16, 2013
Add generic node support and mocha test framework.
The library was changed to support and
respect different data types for node values. Until now, every node
value was implicitly convert to a string.
With this change, numbers and strings and every object implementing
'toString' can be used as node value.

This is a breaking commit. The following changes have been made:

  - Objects used to store nodes as keys have been replaced by
    jsnx.contrib.Map. Every method which used to return an object of
    nodes (such as "G.degree()") returns a jsnx.contrib.Map now.
  - The method "G.get_node" was renamed to "G.get" to be closer to the
    jsnx.contrib.Map interface.

The main difference for user code is the switch from bracket notation
(i.e. "degrees[node]") to the Map interface ("degree.get(node)").
Instead of using a "for...in" loop to iterate over all values, the
".forEach" of the map object can be used.

Since the test cases had to be adjusted to generic nodes, this
opportunity was taken advantage of to change the testing framework from
Jasmine to Mocha, which enables us to write simpler test cases.
Mar 25, 2013
Mar 19, 2013
You can’t perform that action at this time.