Skip to content

Instantly share code, notes, and snippets.

@jsmorph
Last active July 14, 2019 23:01
Show Gist options
  • Save jsmorph/1923387b0539a9cdeb2a10ba9de247d2 to your computer and use it in GitHub Desktop.
Save jsmorph/1923387b0539a9cdeb2a10ba9de247d2 to your computer and use it in GitHub Desktop.
Generating a GUI from generated JSON schema

To run a model, you need a configuration. The structure of a configuration consists of various Go structures, maps, and other types. We use a fork (with only minor changes) of github.com/alecthomas/jsonschema to generate a JSON schema for model configurations. For one GUI, we then use github.com/json-editor/json-editor to generate a complex HTML/Javascript configuration form dynamically from that JSON schema. A Go program serves the HTML and Javascript, and that program also runs then model. The model output is rendered using d3js.org.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment