# Necessary imports for this doc page
from fiatlight.fiat_notebook import plantuml_magic, display_markdown_from_fileClass diagrams¶
fiat_core¶
This is the foundational package of the fiatlight framework. It focuses on wrapping data and functions with GUI elements to facilitate interaction.
Classes
AnyDataWithGui: Wraps any type of data with a GUI. This class manages the data value and its associated callbacks, and it provides methods to serialize/deserialize the data to/from JSON.AnyDataGuiCallbacks: Stores callback functions for AnyDataWithGui, enhancing interactivity by allowing custom widgets and presentations.FunctionWithGui: Encapsulates a function, enriching it with a GUI based on inferred input and output types. It handles function invocation and manages internal states like exceptions and execution flags.ParamWithGuiandOutputWithGui: These classes link parameters and outputs of functions to their GUI representations.FunctionNode: Represents a node in a function graph, containing links to other function nodes and managing data flow between them.FunctionNodeLink: Defines a link between outputs of one function node and inputs of another, facilitating data flow in the function graph.FunctionsGraph: Represents a graph of interconnected FunctionNode instances, effectively mapping the entire functional structure.
%plantuml_include class_diagrams/fiat_core.pumlfiat_togui¶
fiat_togui provides functions to register new types (classes, dataclasses, enums) so that they are associated with a GUI.
Functions
register_type(type_, gui_type): register a GUI for a given type. gui_type must be a descendant of AnyDataWithGuiregister_enum(enum_type)and the equivalent decoratorenum_with_gui_registration: register an enumregister_dataclassand the equivalent decoratordataclass_with_gui_registration: register a dataclass base modelregister_base_modeland the equivalent decoratorbase_model_with_gui_registration: register a pydantic base model
Classes
IntWithGui,FloatWithGui, etc.: provides GUI for primitive types (int, str, float, bool)OptionalWithGui: able to add GUI to Optional[DataType] (if DataType is registered)
%plantuml_include class_diagrams/fiat_togui.pumlfiat_runner¶
fiat_runner is the package that contains the “run” functions:
Free function
fiat_run accepts either a standard function, a list of functions, or a graph of functions. It executes the function(s) and displays the results in a GUI.
fiat_run(fn)# fn is a function or a FunctionWithGuifiat_run([fn1, fn2, ...])# list of functions or FunctionWithGuifiat_run(graph)# A FunctionsGraph
Classes
FiatlightGui: The main runtime class that presents a GUI for interacting with a function graph. It orchestrates the execution and user interaction.FiatlightGuiParams: Stores configuration and parameters for the GUI application, such as visibility toggles and other settings.
%plantuml_include class_diagrams/fiat_runner.pumlfiat_nodes¶
fiat_nodes is the package that is able to display a function graph in a node editor (using imgui-node-editor)
As a final user, you will probably not interact with it.
Classes
FunctionNodeGui: The GUI representation of a FunctionNodeFunctionNodeLinkGui: The GUI representation aspect of a FunctionNodeLinkFunctionsGraphGui: The GUI representation of a FunctionsGraph
%plantuml_include class_diagrams/fiat_nodes.pumlFull diagram¶
Below is the full class diagram
%plantuml_include class_diagrams/all.pumlFolder structure¶
Below is the folder structure of the fiatlight framework.
display_markdown_from_file("folder_structure.md")