Version 10 (modified by ehb, 8 months ago) (diff) |
---|
layout generation
- 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 )
- sets up panel defaults
- inserts buttons if not specified
- special inserts (progress, output_msgs, etc)
- extracts field & layout info and fillout layout object with data needed for layout
- phase 1 - panels
- check for missing panels and assigns parent panels
- collect parent panel names
- validate panelpos & default panel if not specified
- propagate (unspecified) parent keys (gap, align, label, data)
- assign CSS grid info (row, column, spans in parent div)
- check for missing panels and assigns parent panels
- phase 2 - fields
- check for missing parent panels & assign parent panels
- propagate parent keys
- assign CSS grid info (row, column, spans etc in parent div)
- calls layout_prep( modulejsonname, layout, fulljson )
- ga_layout.pm:layout_expand()
- 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
- add submit & reset buttons
- shouldn't this already happen in ga_layout.pm ?
- adds eval for submit & reset (needed)
- calls layout.js:ga.layout.setup()
- recursively builds html for module
- module load
- genapp_util.pl calls ga_layout.pm:layout_expand( modulelayoutname, layout[initially empty object ref], fulljson] )
- genapp
cursors in ga_layout.pm
- 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 location of last grid coordinate used
- initialized to $cursor_{row,col}($parent} at the beginning of field processing
- updated after each component of the field is placed
- $max_{row,col} is the location of the max grid coordinate used
- updated after each component of the field is placed
- $cursor_{row,col}{$parent} is the current location in the "parent" panel
- fields contain multiple components
simplified
module.json -> ga_layout.pm -> layout.js
testing
- /src/genapp/tmp/layout/test2 $ ga_layout.pl energy.json > test1 && node ../layout2html.js test1 > test.html