Skip to content

The manifest

The manifest describes your graphic to LIGR: the entry file, the frame size, the hide deadline, and the control variables an operator can set. Over REST it is the stateMachine field of a code graphic. Keep it in a file named graphic.json next to your source, and send it as stateMachine when you record the bundle.

graphic.json
{
"schemaVersion": 1,
"runtime": {
"engine": "iframe-html",
"entryFile": "index.html",
"width": 1920,
"height": 1080,
"exitDurationMs": 800
},
"controlVariables": [
{ "id": "showAggregate", "name": "showAggregate", "type": "boolean", "defaultValue": false },
{ "id": "accent", "name": "accent", "type": "enum", "defaultValue": "home", "options": ["home", "away", "neutral"] }
],
"userExpressions": []
}

A graphic you create without a stateMachine gets this default: index.html, 1920 by 1080, a 1500 ms hide deadline, and no control variables.

FieldValueRule
engineiframe-htmlRequired. The only engine today
entryFileThe HTML file the overlay loads, as a path inside the bundleRequired. It must name an uploaded file at update and at publish
widthFrame width in pixelsA positive integer. 1920 for a full-frame graphic
heightFrame height in pixelsA positive integer. 1080 for a full-frame graphic
exitDurationMsHow long the overlay waits for HIDDEN after GRAPHIC_HIDE before it hides the frameOptional. A positive integer. Default 1500

A control variable is a value an operator sets in the control room, an automation sets from a rule, or a REST client sends with a graphics command. Your graphic receives the current values in controlVariables and, for entity types, the resolved object in controlVariableData. See Data binding.

You choose the variables. There is no platform list of variable names. Declare any name you need, pick a type from the catalogue below, and the control room renders the picker for it. The only fixed parts are the type catalogue and the reserved hide name.

FieldValue
idThe identifier. Use the same string as name
nameThe name. Unique within the graphic
typeOne of the types below
defaultValueThe value in force when nothing sets the variable
optionsFor enum only. The allowed values. At least one
TypeValue the graphic receivesPicker in the control room
stringA stringText field
numberA numberNumber field
booleantrue or falseSwitch
enumOne of optionsDrop-down
teamA team id. controlVariableData carries the teamTeam picker
playerA player id. controlVariableData carries the playerPlayer picker
matchA match idMatch picker
factA fact id. controlVariableData carries the factFact picker
teamStatA team statisticStatistic picker
statA statisticStatistic picker
set, round, court, periodA set, round, court or period selectorSelector for tennis and period sports

LIGR adds a boolean control variable named hide to every code graphic and sets it when the overlay shows or hides your graphic. Never declare it. A manifest that declares hide with any type other than boolean is refused. Your graphic still hides on GRAPHIC_HIDE, not on the value of hide. See Show and hide.

A user expression is a value the overlay computes for you from the match data, with the same expression language the Rive graphics use. The result arrives in userExpressionValues, keyed by expression name. Most code graphics leave this array empty and compute in JavaScript instead.

{ "id": "leader", "name": "leader", "expression": "$d.1.score > $d.2.score ? $d.1.name : $d.2.name" }
FieldValue
idThe identifier. Use the same string as name
nameThe key in userExpressionValues. Unique within the graphic
expressionThe expression. See Expressions for the language and the context
descriptionOptional. A note for the editor

The API checks the manifest on every write: create, record the bundle, and publish. A failed check returns 400 with code: "CODE_GRAPHIC_INVALID" and one line per broken rule in details[].

RuleMessage in details[]
runtime is an objectruntime must be an object
runtime.engine is iframe-htmlruntime.engine must be "iframe-html"
runtime.entryFile is a pathruntime.entryFile must be a file path
runtime.entryFile names an uploaded fileruntime.entryFile "index.html" is not an uploaded code-file asset
width, height, exitDurationMs are positive integersruntime.width must be a positive integer
controlVariables is an arraycontrolVariables must be an array
Every variable has a namecontrolVariable is missing a name
Names are uniquecontrolVariables has duplicate name "title"
Every type is knowncontrolVariable "title" has unknown type "text"
An enum has optionscontrolVariable "accent" enum needs at least one option
An enum default is one of its optionscontrolVariable "accent" default "blue" is not one of its options
A declared hide is booleancontrolVariables.hide is reserved by LIGR and must be boolean
userExpressions is an arrayuserExpressions must be an array

The entry file rule runs at publish and when you send a stateMachine with the bundle. Record the files and the manifest in the same bundle request, so the check sees both.