Skip to content

Template Fields

benloh edited this page Mar 23, 2025 · 5 revisions

See PR #322

Field Types

Basic Types

  • string
  • number
  • select -- popup menu value list

Special Formatting

  • markdown -- special string field, allows use of markdown
  • hdate -- human date field, converts a string to a sortable, filterable number
  • infoOrigin -- displays as "Created by TOKEN on DATE TIME", but can be edited

System Fields

  • timestamp -- Allows built-in date fields to be sorted and filtered using human date field strings. Not intended to be customized by users.
  • node -- Used internally to define source/target nodes in edges. Not intended to be customized by users.
  • weight -- Displays stroke width as the sum of all weights that share the same source and target nodes.

Features



infoOrigin field

infoOrigin is a special field. Initially the value will be set to Created by <createdby> on <created>, but upon editing it behaves like a string field so you can edit the field to say anything you want. Once you edit the field, the field behaves like a string field.

infoOrigin honors both isProvenance and hidden parameters.


Edge weight

Edges will display weights as <weight> (<sum>) where <sum> is the sum of all the weights that share the same source and target nodes. The <sum> is not directional -- e.g. A->B and B->A are both summed when calculating sum.

<sum> is used to determine the stroke width of the edge link. AKA size.

edgeSizeMax sets maximum stroke (visual only)

Templates can define an edgeSizeMax value. This is used to limit the stroke width of links in the graph view to keep links from overwhelming the graph.

It does not affect the ability to enter weights larger than edgeSizeMax nor the sum of the weights in the weight field.

Default Value

You can set the defaultValue to something other than 1 if you want all edges to start with a larger weight.

NOTES

  • type = "weight" is not necessary. nc-ui and NCEdgeTable both determine display and sort times by referencing the built in weight field definition, rather than relying on a type parameter.
[edgeDefs.weight]
type = "weight"
defaultValue = 1
displayLabel = "Weight"
exportLabel = "Weight"
help = "Weight of edge"
includeInGraphTooltip = true
isRequired = true
isProvenance = false
hidden = false

Provenance Tab

Adding fields to the "Provenance" section

In project templates, use isProvenance = true to add a field to the Provenance Section of a Node or Edge Editor. Any field type can be supported.

"History" section

The "History" section of the tab uses five built-in fields:

  • created -- date of creation
  • createdby -- token of user who created the object
  • updated -- date of update of the object
  • updatedby -- token of user who updated the object
  • revision -- a count of the number of times the object has been revised.

The "History" shows a combination of fields:

  • "Created" = createdby + created
  • "Updated" = upatedby + updated

hidden parameter

The history fields may be hidden in the Node/Edge Editors and Tables by using hidden = true, but they will always be exported and imported.

  • If created is hidden, then the whole "Created: , " line is hidden.
  • If createdby is hidden, then only the user is hidden, e.g. the line will display "Created: "
  • updated and updatedby work the same way.

isProvenance parameter

The "History" section ignores the isProvenance = true flag. It is a built-in field that will always be placed in the "History" section (as long as it's not hidden).

Clone this wiki locally