Version 9 (modified by ehb, 8 months ago) (diff)


layout generation

  • layout is specified in module.json

  • processing steps:
    1. genapp
      1. calls modulelayoutname, layout[initially empty object ref], fulljson] )
          1. calls layout_prep( modulejsonname, layout, fulljson )
            1. sets up panel defaults
            2. inserts buttons if not specified
            3. special inserts (progress, output_msgs, etc)
            4. extracts field & layout info and fillout layout object with data needed for layout
          2. phase 1 - panels
            1. check for missing panels and assigns parent panels
              1. collect parent panel names
              2. validate panelpos & default panel if not specified
            2. propagate (unspecified) parent keys (gap, align, label, data)
            3. assign CSS grid info (row, column, spans in parent div)
          3. phase 2 - fields
            1. check for missing parent panels & assign parent panels
            2. propagate parent keys
            3. assign CSS grid info (row, column, spans etc in parent div)
      2. generated application
        1. module load
          1. ga.layout structure setup (from types/type{.input|.output})
          2. ga.layout.process( defaults )
            • source in js/layout.js
            • consumes ga.layout definitions
            1. add submit & reset buttons
              • shouldn't this already happen in ?
              • adds eval for submit & reset (needed)
            2. calls layout.js:ga.layout.setup()
              • recursively builds html for module

cursors in

  • 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
      • "next" - begin new row (like carriage return) only currently supported for row
    • 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


module.json -> -> layout.js


  • /src/genapp/tmp/layout/test2 $ energy.json > test1 && node ../layout2html.js test1 > test.html