-
Notifications
You must be signed in to change notification settings - Fork 0
Archive Trac docs layout generation
madscatt edited this page Jun 20, 2026
·
1 revision
Legacy Trac archive page imported from
docs_layout_generation. Source: https://genapp.rocks/wiki/wiki/docs_layout_generation. Review age, links, and examples before treating as current.
-
layout is specified in module.json
-
processing steps:
- genapp
- genapp_util.pl calls ga_layout.pm:layout_expand( modulelayoutname, layout[initially empty object ref], fulljson] )
- ga_layout.pm:layout_expand()
- calls layout_prep( modulejsonname, layout, fulljson ) 1. sets up panel defaults 1. inserts buttons if not specified 1. special inserts (progress, output_msgs, etc) 1. extracts field & layout info and fillout layout object with data needed for layout
- phase 1 - panels 1. check for missing panels and assigns parent panels 1. collect parent panel names 1. validate panelpos & default panel if not specified 1. propagate (unspecified) parent keys (gap, align, label, data) 1. assign CSS grid info (row, column, spans in parent div)
- phase 2 - fields 1. check for missing parent panels & assign parent panels 1. propagate parent keys 1. assign CSS grid info (row, column, spans etc in parent div)
- generated application
- module load
- ga.layout structure setup (from types/type{.input|.output})
- ga.layout.process( defaults ) - source in js/layout.js - consumes ga.layout definitions 1. add submit & reset buttons - shouldn't this already happen in ga_layout.pm ? - adds eval for submit & reset (needed) 1. calls layout.js:ga.layout.setup() - recursively builds html for module
- fields
- fields contain multiple components
- currently label, data, repeats
- each field is placed at a location within the panel described by the field's layout:location
- field's layout:location types for row or col
- number - a numeric coordinate
- [start#, end#] - a range of coordinate numbers
- "full" - the complete row or column - only currently supported for col on component "repeats"
- "next" - begin new row (like carriage return) only currently supported for row on component "repeats"
- cursors:
- $cursor_{row,col}{$parent} is the current location in the "parent" panel
- initially updated after the "setup" of the field in the panel
- updated after the field is fully placed past the max_{row,col}
- $loc_{row,col} is the base starting location for the field
- initialized to $cursor_{row,col}($parent} at the beginning of field processing
- $max_{row,col} is the location of the max grid coordinate used
- updated after each component of the field is placed
module.json -> ga_layout.pm -> layout.js
- /src/genapp/tmp/layout/test2 $ ga_layout.pl energy.json > test1 && node ../layout2html.js test1 > test.html