Communicating logic with flowcharts
Flowcharts are effective ways of communicating a process, such as code execution or how your code’s domain logic should work.
In Polyglot Notebooks we can add a new code cell and then change the language to mermaid – Mermaid in order to work with Mermaid.
Next, let’s add in some Mermaid notation specific to flowcharts:
flowchart LR load[Load Data] --> split[Split Data] split --> train[Train Model] train --> test[Test Model] split --> test --> predict[Predict New Values]
This notation starts with flowchart LR
, which informs Mermaid of the specific diagram type – a flowchart. This is important because each diagram type in Mermaid has a different syntax, as you’ll see in this chapter.
The LR
indicator is optional but tells the flowchart diagram we want it to render in left-to-right mode instead...