Skip to content

Using Templates

benloh edited this page Sep 13, 2025 · 10 revisions

Overview

This Page

Other Wiki Pages

How Templates Work

Templates define a hodge-podge of things:

  • Project name and description
  • Administrative parameters like secret keys for tokens and admin passwords
  • Project settings and messages
  • UI elements available in the Settings Panel
  • Fields for nodes and edges

Each project is associated with a single template file. e.g. if your project name is tacitus.loki, the associated template is tacitus.template.toml.

Different users will have different template-related tasks they need to accomplish:

  • Teachers
    • Show, hide, or rename predefined fields
    • Add/remove selection options (e.g. type) and set corresponding color
    • Change the project name, description, secret key, and admin password.
  • Researchers
    • Define which fields are visible in the Settings Panel UI.
  • Developers
    • Define criteria for validating a template -- e.g. ensuring that the fields that have been defined match a known set of values.
    • Define which fields can be set by the Settings Panel UI.
    • Define a starting set of fields for the default template: _default.template.toml

Common Tasks for Teachers

Teachers should generally make use of the Settings Panel to:

Define Node/Edge Type Labels

The most common template editing task for Teachers will be setting up types for Nodes and Edges. In general, the best approach is to start with the predefined colors and change the labels, removing any unecessary colors.

The colors are the "2.1 bright" colors from Paul Tol https://cran.r-project.org/web/packages/khroma/vignettes/tol.html. These colors are colorblind-friendly and are known to work well with Net.Create:

  • Gray (Default) #bbbbbb
  • Blue #4477aa
  • Cyan #66ccee
  • Green #228833
  • Yellow #ccbb44
  • Red #ee6677
  • Purple #aa3377

The type labels are unsorted by default and should be displayed in the Node/Edge Editor Panels in the order in the template. If you want a specific ascending or descending alphabetical order, select the sort. Note once the types have been sorted, they cannot be unsorted.

Customizing a Field

The easiest way to customize a template is to do two things:

  • rename the "Label fo Display" for an existing field
  • hide/show an existing field

e.g. if you want to display a number of book types...

  1. Rename the "[type]" field's "Label for Display" to "Book Type"
  2. Change the existing node types (e.g. change "Blue" to "Fiction") and delete any extra fields

e.g. if you don't need the second "[sometype]" field...

  1. Check "Hide Field" for the "[sometype]" field. This will hide the "Some Type" field from
  • Node Editor
  • Node Table

Common Tasks for Researchers

  • Define Node/Edge Types (especially color scheme)
  • Hide/Show a Field in Settings Panel

Customizing the Settings Panel for Teachers

The Settings Panel UI is defined via [_ui.*] definitions in each template. You can use this to turn on/off specific widgets in the template. For exmaple,

Developers/Researchers Configuration

Things you can do:

  • Hide a field from the Settings Panel -- add // to [_ui.*]..._control

  • Turn off validation

Tip

You can make a field "required" and not-editable by Teachers in the Settings Panel by: a. comment out the [_ui.*] _control , e.g. _control = "// in_composite" b. leave the [nodeDef.*] visible (not hidden)

Clone this wiki locally