How etcetra7n/gryphon works
Main Components
• Main Application Flow – The entry point is found in src/Main/main.cpp, which orchestrates the overall processing.
• Input Parsing – The src/Parser directory (with files like parser.cpp, parser.h, endian.cpp) handles reading and interpreting the various input formats.
• Data Handling – The src/Data directory (with parseGDT.cpp, data.h, roll.cpp/roll.h) is responsible for reading and structuring graph related data.
• Layout Computation – In src/Layout, modules like layout.h and parseGGL.cpp likely compute node positioning and relationships.
• Template & DOM Manipulation – The src/Template folder (with files such as dom.cpp, gtml.h, parseGTML.cpp) handles the HTML-like templating, resembling a DOM tree for graph elements.
• Plotting & Export – The src/Plot (composeGPLT.cpp, plot.h) and src/Export (exportBmp.cpp, export.h) modules transform processed data into visual representations (bitmap exports) and possibly plotting instructions.
• Raster Processing – In src/Raster (raster.cpp), the system might convert vector graphics to a raster format, complementing the export/plot process.
Relationships and Interactions
• The Main Module functions as the controller—it invokes the Parser to interpret input files provided by the user.
• Once parsed, the Data module creates internal representations of the graph’s elements.
• The Layout module then takes these structured data and computes spatial arrangements.
• The Template system may be used to further “decorate” or structure graph elements in an HTML-like style, providing extensibility and reusability.
• Next, the Plot module composes the visual output, potentially using inputs from Layout and Template, while the Export module finally converts the resultant composition (e.g., into BMP format).
• The Raster module supports this by handling any necessary rasterization steps.
Architectural Patterns
• Modular Design – Each major function (parsing, data, layout, templating, plotting, exporting, and rasterization) is encapsulated in its own module. This promotes separation of concerns.
• Layered Processing Pipeline – The workflow follows a pipeline: input is parsed → data structured → layout defined → template applied → plotting/visual output → export. This sequential flow is central to the system’s design.
• Extensibility – The presence of a Template system suggests an intention to allow users to extend or customize the graph’s presentation, similar to how HTML and CSS work together.
Relevant Technologies and Frameworks
• C++ for core implementation.
• CMake (with CMakeLists.txt and cmake/CxxWarnings.cmake) for build configuration.
• GitHub Workflows for CI/CD (build.yml and codeql.yml).
• Documentation using Sphinx (evidenced by docs/conf.py and accompanying reStructuredText files).
• The project might also integrate external libraries (not directly shown but implied by the modularized design) for tasks such as graphics rendering or image exporting.
Specific Elements
– Main Controller (entry point)
– Parsing Module
– Data Handling Module
– Layout Computation Module
– Template/DOM Module
– Plot Composition Module
– Export Module
– Raster Processing Module
– From Main to Parser, then to Data, followed by Layout.
– From Layout to Template and/or Plot.
– Plot feeding into Export and Raster for final image production.
• Optionally, annotate with the key C++ files or directories that back each module for clarity.