1 00:00:00,120 --> 00:00:07,260 In this lecture, we are going to explore the concept of a marble diagram sprinkled throughout the documentation 2 00:00:07,260 --> 00:00:09,450 are these mysterious diagrams. 3 00:00:09,790 --> 00:00:14,130 They're incredibly helpful for describing behavior of an operator. 4 00:00:14,460 --> 00:00:19,650 In the resource section of this lecture, I provide a link to the map operator. 5 00:00:20,130 --> 00:00:26,370 Scrolling through the page, you will find a diagram that looks like this on almost any page. 6 00:00:26,520 --> 00:00:31,800 You will find a marble diagram to help you understand how the operator works. 7 00:00:32,549 --> 00:00:34,500 SJS is very verbose. 8 00:00:34,770 --> 00:00:37,230 They don't shy away from their terminology. 9 00:00:37,530 --> 00:00:40,170 As wonderful as the documentation is. 10 00:00:40,350 --> 00:00:45,510 It can be difficult to understand how an observable works just in case. 11 00:00:45,870 --> 00:00:51,360 Marble diagrams give a clear and concise example of how an operator functions. 12 00:00:52,580 --> 00:01:00,320 Let's learn how to read a marble diagram, a marble diagram is a visual representation of how an operator 13 00:01:00,320 --> 00:01:01,070 behaves. 14 00:01:01,400 --> 00:01:04,280 Operators have inputs and outputs. 15 00:01:04,610 --> 00:01:09,620 The input refers to the data received by the operator on the output. 16 00:01:09,830 --> 00:01:12,890 It'll show us the values pushed by the operator. 17 00:01:13,460 --> 00:01:20,660 Marble diagrams will show us the relationship between the input and output by drawing a horizontal line. 18 00:01:21,080 --> 00:01:24,610 The line represents the passage of time from left to right. 19 00:01:25,160 --> 00:01:30,020 Image within the input and output is an example of how to use the operator. 20 00:01:30,350 --> 00:01:33,680 In this example, I'm showing you the map operator. 21 00:01:33,980 --> 00:01:36,920 It's the same code we wrote in the previous lecture. 22 00:01:37,610 --> 00:01:44,750 The last component of a marble diagram are the marbles, the marbles or circles with values inside them 23 00:01:45,020 --> 00:01:46,240 on the first line. 24 00:01:46,280 --> 00:01:50,450 We are given an example of values that are pushed into the operator. 25 00:01:50,810 --> 00:01:55,220 The second line will show us the transformation applied to the values. 26 00:01:55,460 --> 00:01:59,420 In this case, we are pre seeing the dollar sign symbol. 27 00:01:59,990 --> 00:02:07,220 In some cases, if an operator can complete an observable, a vertical line will appear in the diagram. 28 00:02:07,520 --> 00:02:11,030 This line represents the completion of an observable. 29 00:02:11,600 --> 00:02:14,030 An X can appear on the diagram. 30 00:02:14,270 --> 00:02:19,650 This symbol represents an error not often used, but something you should know about. 31 00:02:20,150 --> 00:02:26,720 Marble diagrams can help us understand how an operator works by comparing the values from the input 32 00:02:26,720 --> 00:02:27,590 and output. 33 00:02:27,950 --> 00:02:32,870 They visualize the behavior of an operator for the rest of this course. 34 00:02:33,050 --> 00:02:39,170 We are going to review the behavior of an operator before writing code in the next lecture. 35 00:02:39,290 --> 00:02:43,130 We are going to continue exploring additional operators.