forked from bonsai-rx/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/bonsai-rx/docs-wip into b…
- Loading branch information
Showing
14 changed files
with
126 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,24 @@ | ||
## What is Bonsai? | ||
|
||
Bonsai is a visual programming environment for creating reactive systems. Open source system that can flexibly integrate across any combination of hardware as needed. | ||
Bonsai is a programming language with the following major features: | ||
|
||
## Getting Started | ||
1. **It operates on sequences of elements that are ordered in time.** Elements within these sequences can be any kind of data (images, numbers, strings, etc), and these sequences can be either finite or infinite. Elements within sequences can occur regularly or irregularly and do not need to conform to any underlying clock -- sequences are asynchronous. Most hardware that interacts with the world is asynchronous: a human using a keyboard can produce a sequence of keystrokes, and a webcam can produce a sequence of images, but the time of each keypress and image capture is unrelated. Bonsai addresses this fact at the core of its design and is therefore particularly good at interacting with the physical world. | ||
|
||
1. Download Bonsai from [http://bonsai-rx.org](http://bonsai-rx.org). | ||
2. Install **Bonsai - Starter Pack** from the package manager. ![The Bonsai package manager](~/images/packagemanager.png) | ||
3. Click on the `Updates` tab at the top of the screen and install any available upgrades. | ||
4. Read [http://bonsai-rx.org/docs/editor](http://bonsai-rx.org/docs/editor) for an introduction to the user interface. | ||
![A simple sequence](../images/simple-sequence.svg) | ||
|
||
_Footnote: If you look at the source code of Bonsai, the technical name for the datatype of all sequences in Bonsai is "IObservable"._ | ||
|
||
2. **It is (strictly) composable.** Operations on sequences (generation, filtering, combining, etc.) are composed in order to define new sequences. In this way, Bonsai operators are much closer to normal mathematical functions than those in many of the programming languages with which you might already be familiar. In fact, one can think of Bonsai as an algebra that operates on temporal sequences in a similar way to how linear algebra operates on matrices. | ||
|
||
3. **It is a visual language.** Operator composition is defined using a graphical tool. To define a composition, operators are linked together in order to form a visual graph (in the mathematical sense), which is called a "workflow" in Bonsai. Each node defines a sequence and each connection gives a node the option to get data from the connected preceding node(s). | ||
|
||
The visual language of Bonsai can be read using the following colour code: | ||
|
||
### How to read Bonsai code | ||
|
||
The visual language of Bonsai contains the following 4 major colors: | ||
|
||
- **Green == Sources.** Sources generate sequences of data and do not require an input connection. Some sources generate infinite sequences (i.e. webcams), while others generate finite sequences (i.e. movie files). | ||
- **Blue == Transforms.** Transforms always have a single input connection. Transforms apply some operation on the elements of the incoming sequence, and every element of the input sequence is transformed into an element in the output sequence, with no changes to order or rate. | ||
- **Orange == Combinators.** Combinators take one or more input sequences and apply some sort of control flow. With a combinator node, you can combine data, monitor various sequences, generate new events, drop events, etc. Most of the reactive operators fall into this category, and most of the complexity of a Bonsai workflow lies in the orange nodes. | ||
- **Purple == Sinks.** Sinks take one sequence as input and output the exact same sequence, but they cause some kind of side effect outside of Bonsai (i.e. save data to a file, turn on or off some hardware, etc). Sinks do not change the elements in a sequence, and therefore can be placed anywhere in a workflow without changing its operation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.