AlgoFlux API Reference

Create powerful algorithms on the web for over 100+ platforms!


The API is divided into three simple parts.

  1. AlgoFlux Runtime (algoflux.runtime.js)

    Includes libraries for data-structures, algorithms, processing and helper functions.

    This library is open-source and available online at Github.

  2. AlgoFlux Controls (controls.js)

    Includes libraries for input controls and UI components.

  3. AlgoFlux Output (output.js)

    Includes libraries for data and information output.

1. AlgoFlux Runtime

Runtime deals with data-processing, structures and algorithms that come built-in with the AlgoFlux IDE. This runtime can also be used stand-alone in any web based application. You can find the source code at Github.

This library is composed of:

Helper Modules

AlgoFlux Runtime provides the following static modules:

  1. Matrix related methods (MatrixH).
  2. Mathematical functions (MathH).
  3. Object related functions (ObjectH).
  4. Array related functions (ArrayH).
  5. Colors manipulation (ColorH).
  6. Digital image processing (ImageProcessingH).
  7. Miscellaneous helper functions (Helpers).

Data-structure Classes

  1. Graph creation and manipulation (Graph).
  2. Maze creation and functions (Maze).
  3. Linked-list creation and operations (LinkedList).
  4. Queue creation and operations (Queue).
  5. Stack creation and operations (Stack).

2. AlgoFlux Controls

AlgoFlux provides various forms of UI controls for data and information inputs.

This namespace has the following classes.

  1. Matrix (Controls.Matrix).
  2. Table (Controls.Table).
  3. Datasheet (Controls.Datasheet).
  4. Dropdown (Controls.Dropdown).
  5. Text (Controls.Text).
  6. Textarea (Controls.Textarea).
  7. Graph (Controls.Graph).
  8. Scatterplot (Controls.Scatter).
  9. ImageSelector (Controls.ImageSelector).
  10. Maze (Controls.Maze).
  11. Logo3D (Controls.Logo3D).

3. AlgoFlux Output

For data output and display, AlgoFlux provides a special Out class that makes use of the UI Controls in the background to provide simple data output functions.

This namespace has the following components.

Output Functions

These functions are used for quick output and display.

  1. Clear screen (Out.clear).
  2. Show an element (Out.element).
  3. Show HTML (Out.html).
  4. Display table (Out.table).
  5. Display matrix (Out.matrix).
  6. View information (
  7. View error (Out.error).
  8. View success (Out.success).
  9. View text (Out.text).
  10. View hint (Out.hint).
  11. Debug a variable (Out.debug).
  12. Show a Graph (Out.graph).
  13. Show a Maze (Out.maze).
  14. Show a Scatter plot (Out.scatterPlot).
  15. Inspect an Array (Out.array).
  16. Inspect a LinkedList (Out.linkedList).
  17. Inspect a Stack (Out.stack).
  18. Inspect a Queue (Out.queue).
  19. Display a bar chart (Out.barChart).
  20. Display a line chart (Out.lineChart).
  21. Display a radar chart (Out.radarChart).
  22. Display a polar chart (Out.polarChart).
  23. Display a doughnut chart (Out.doughnutChart).
  24. Display a pie chart (Out.pieChart).
  25. Display a line chart (Out.lineChart).
  26. Display an image (Out.image).

Output Classes

These classes are used to customize the way output is diplayed on screen.

  1. Slider (Out.Slider).
  2. Center (Out.Center).
  3. Grid (Out.Grid).


Following examples can be viewed and executed online. They make use of the libraries explained above.


Please check out our Getting Started guide or the Video Tutorial.


AlgoFlux Runtime is open-source and available online at Github. Please submit bug reports, suggestions and pull requests to the GitHub issue tracker.

License (For AlgoFlux Runtime)

The MIT License (MIT) Copyright (c) 2011-2015 Twitter, Inc Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.