{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "InteractionMetric",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "number",
      "description": "Milliseconds since the UNIX epoch when the event occurred."
    },
    "x": {
      "type": "number",
      "description": "X coordinate on the canvas where the interaction occurred (0–1 relative units)."
    },
    "y": {
      "type": "number",
      "description": "Y coordinate on the canvas where the interaction occurred (0–1 relative units)."
    },
    "event": {
      "type": "string",
      "enum": ["move", "click", "touchstart", "touchmove", "touchend", "questionResponse"],
      "description": "Type of interaction recorded."
    },
    "latency": {
      "type": ["number", "null"],
      "description": "Time difference between this event and the previous event from the same user in milliseconds."
    },
    "value": {
      "type": ["number", "string", "null"],
      "description": "Optional value associated with the event (e.g. answer to a question)."
    },
    "axisScores": {
      "type": "object",
      "description": "Computed scores for each psychometric axis at this time.",
      "additionalProperties": {
        "type": "number"
      }
    }
  },
  "required": ["timestamp", "x", "y", "event"]
}
