Using CODED FLOWS

Types of Bricks

In CODED FLOWS, Bricks are the core components that enable users to build flows visually. There are eight distinct types of Bricks, each designed for a specific role in creating data processing and visualization flows. This section explores each brick type, providing descriptions and examples to help you understand their applications.


Function Bricks

Function Bricks are processing units that represent Python functions visually. They allow you to integrate custom logic and computations into your flows by taking inputs, processing them according to the defined function, and producing outputs for further connections.

Graph Bricks

Graph Bricks enable the display of data visualizations using Vega-Lite. These Bricks allow you to create interactive charts and graphs within your flow, providing insights by connecting them to data sources.

Entry Bricks

Entry Bricks facilitate data input into flows. They come in several subtypes tailored to different needs:

  • Text entry: For single-line text input.
  • Multiline text entry: For longer text inputs.
  • Folder selection entry: For selecting a directory.
  • File selection entry: For selecting a file.
  • Script entry: For code scripts (like SQL, Bash etc...).

These Bricks are crucial for flows that rely on user-provided data or external sources, and they are available in the base package named ENTRIES.

Control Bricks

Control Bricks manage the logic and flow of flows. They include:

  • Sequence Bricks: Execute sub-flows in a defined order.
  • For loops: Iterate over collections of data.
  • While loops: Repeat actions based on a condition.
  • If condition: Conditional logic.
  • Try-catch blocks: Handle errors gracefully.
  • Environment variable loaders: Access environment variables.
  • Project path: Access the project path.

These Bricks provide the structure needed for complex flow designs, and they are available in the base package named FLOW CONTROL.

Variable Bricks

Variable Bricks allow you to set and get variables within a flow. They help store intermediate results, share data across the flow, and maintain state as needed.

Session Variables

In addition to "normal" variables when creating a UI flows you can use session variables that maintains values between streamlit refreshing and pages.

UI Bricks

UI Bricks bring Streamlit visual elements into flows as connectable components, and they also enable the addition of interactive features like buttons, sliders, and forms, enhancing flow interactivity.

Converter Bricks

Converter Bricks are automatically generated by CODED FLOWS when a connection involves two incompatible but convertible data types. They seamlessly handle type conversions to maintain smooth data flow.

Display Bricks

Display Bricks present various data types within the flow. They include the following subtypes:

  • Image Brick: Displays images in supported formats.
  • Table Brick: Shows tabular data, such as dataframes, in a readable layout.
  • Map Brick: Visualizes geographical data with coordinates for plotting points.
  • Text Brick: Displays text or scripts in various languages.

These Bricks make it easy to view and interpret flow outputs, and they are available in the base package named DISPLAYS.

This overview of brick types equips you with the knowledge to leverage CODED FLOWS effectively. Each brick type plays a unique role, enabling you to craft powerful and flexible flows tailored to your needs.

Previous
Understanding Bricks