In this lecture, we are going to explore the concept of a marble diagram sprinkled throughout the documentation
are these mysterious diagrams.
They're incredibly helpful for describing behavior of an operator.
In the resource section of this lecture, I provide a link to the map operator.
Scrolling through the page, you will find a diagram that looks like this on almost any page.
You will find a marble diagram to help you understand how the operator works.
SJS is very verbose.
They don't shy away from their terminology.
As wonderful as the documentation is.
It can be difficult to understand how an observable works just in case.
Marble diagrams give a clear and concise example of how an operator functions.
Let's learn how to read a marble diagram, a marble diagram is a visual representation of how an operator
behaves.
Operators have inputs and outputs.
The input refers to the data received by the operator on the output.
It'll show us the values pushed by the operator.
Marble diagrams will show us the relationship between the input and output by drawing a horizontal line.
The line represents the passage of time from left to right.
Image within the input and output is an example of how to use the operator.
In this example, I'm showing you the map operator.
It's the same code we wrote in the previous lecture.
The last component of a marble diagram are the marbles, the marbles or circles with values inside them
on the first line.
We are given an example of values that are pushed into the operator.
The second line will show us the transformation applied to the values.
In this case, we are pre seeing the dollar sign symbol.
In some cases, if an operator can complete an observable, a vertical line will appear in the diagram.
This line represents the completion of an observable.
An X can appear on the diagram.
This symbol represents an error not often used, but something you should know about.
Marble diagrams can help us understand how an operator works by comparing the values from the input
and output.
They visualize the behavior of an operator for the rest of this course.
We are going to review the behavior of an operator before writing code in the next lecture.
We are going to continue exploring additional operators.