SGF Author

Comment


                        

SGF (Smart Go Format / Smart Game Format)

SGF

The Smart Game Format (SGF), is the standard format for storing Go games. GNU Go supports both reading and writing SGF files. The SGF specification is at: http://www.red-bean.com/sgf/

The SGF Viewer is based on besogo

  • Usable offline, cross-platform with no installation (just download the source and open testing.html)
  • Embeddable, responsive, and modular
  • Editor, viewer, and diagram widgets (see examples below)
  • Position editing, custom markup, comment, and game info tools
  • Keyboard and mousewheel navigation
  • Game tree navigator
  • Supports both "sibling" and "child" variation markup styles
  • Multiple board coordinate labeling options (toggle with the 四4 button)
  • Realistic board and stone textures (CC-licensed assets from other projects)
  • Written in JavaScript, CSS, and HTML5 with no dependencies
  • Free, open-source software (AGPL license)

SGF Viewer API - JavaScript files in js/ folder

    besogo.js establishes name space, core functions autoInit and create compose the editor and GUI objects
    editor.js core editor logic managing game tree, handling input from GUI panels, and notifying GUI panels of state changes
    gameRoot.js data structure that internally represents the game tree
    boardDisplay.js essential board display GUI panel
    controlPanel.js GUI panel for navigation control buttons
    namesPanel.js GUI panel for player names, ranks, and captures
    commentPanel.js GUI panel for comments and game info
    toolPanel.js GUI panel for tool selector buttons
    treePanel.js GUI panel for game tree visualization
    filePanel.js GUI panel for save, load, and new board buttons
    coord.js utility functions for coordinate system labels
    svgUtil.js utility functions for SVG composition
    parseSgf.js parses and extracts data structure from SGF text
    loadSgf.js loads SGF data structure into game tree
    saveSgf.js composes SGF file from game tree data structure