Git Product home page Git Product logo

autoblocks.js's Introduction

autoblocks.js

Autoblocks.js makes it easy to create dynamic graphs or trees of HTML elements that magically rearrange themselves on the fly as new elements are added, dimensions are changed, or relationships are added. These relationships can be trivially specified by adding classes to elements, or by linking Autoblocks.js to a Backbone.js collection whose model attributes specify parent-child relationships. This library can be run in Node.js or in any reasonably performant browser (Chrome and Firefox tested).

Autoblocks.js is licensed under the LGPL v2.1, so it can be used alongside proprietary (obfuscated) Javascript code. However, any published modifications to this library itself, or its components, must be released under the LGPL or GPL v2 or v3.

Implementation

Autoblocks.js accomplishes this with the first-ever Javascript implementation of a linear program optimizer, which optimizes a simple objective function subject to a set of constraints. HTML elements or Backbone models are translated into these constraints by customizable "Binders" and "Constrainers", and the solution of the linear program updates the locations in a deterministic way.

The specific algorithm implemented in src/lp.js is the parametric self-dual simplex method presented in Chapter 7 of Robert J. Vanderbei's Linear Programming: Foundations and Extensions, which can be downloaded at an archived version of the author's website. Note that this implementation did not use the source code provided on Prof. Vanderbei's website as a reference, as its licensing requirements are unclear. Autoblocks makes use of the Sylvester linear algebra library.

Note that much of the source code is written in CoffeeScript.

Testing

Jasmine is used for testing.

In the main directory:

node node_modules/jasmine-node/lib/jasmine-node/cli.js --runWithRequireJs --verbose .

autoblocks.js's People

Contributors

bpartridge avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.