Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions spec/v0.7.1-draft/extensions/anchored-node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://spec.canvasprotocol.org/v0.7.1/extensions/anchored-node.json",
"title": "@ocif/anchored-node",
"description": "Anchored node extension for relative positioning anchored to a parent item",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "@ocif/anchored-node"
},
"topLeftAnchor": {
"description": "Top left anchor as percentage coordinates",
"oneOf": [
{
"type": "array",
"items": {
"type": "number"
},
"minItems": 2,
"maxItems": 2
},
{
"type": "array",
"items": {
"type": "number"
},
"minItems": 3,
"maxItems": 3
}
],
"default": [0.0, 0.0]
},
"bottomRightAnchor": {
"description": "Bottom-right anchor as percentage coordinates",
"oneOf": [
{
"type": "array",
"items": {
"type": "number"
},
"minItems": 2,
"maxItems": 2
},
{
"type": "array",
"items": {
"type": "number"
},
"minItems": 3,
"maxItems": 3
}
],
"default": [1.0, 1.0]
},
"topLeftOffset": {
"description": "Top left offset as absolute coordinates",
"oneOf": [
{
"type": "array",
"items": {
"type": "number"
},
"minItems": 2,
"maxItems": 2
},
{
"type": "array",
"items": {
"type": "number"
},
"minItems": 3,
"maxItems": 3
}
],
"default": [0.0, 0.0]
},
"bottomRightOffset": {
"description": "Bottom-right offset as absolute coordinates",
"oneOf": [
{
"type": "array",
"items": {
"type": "number"
},
"minItems": 2,
"maxItems": 2
},
{
"type": "array",
"items": {
"type": "number"
},
"minItems": 3,
"maxItems": 3
}
],
"default": [0.0, 0.0]
}
},
"required": ["type"]
}
61 changes: 61 additions & 0 deletions spec/v0.7.1-draft/extensions/arrow.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "@ocif/arrow",
"description": "Arrow node extension",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "@ocif/arrow"
},
"strokeWidth": {
"type": "number",
"description": "The line width.",
"default": 1
},
"strokeColor": {
"type": "string",
"description": "The color of the stroke.",
"default": "#FFFFFF"
},
"fillColor": {
"type": "string",
"description": "The color of the fill."
},
"start": {
"type": "array",
"items": {
"type": "number"
},
"minItems": 2,
"maxItems": 2,
"description": "The start point."
},
"end": {
"type": "array",
"items": {
"type": "number"
},
"minItems": 2,
"maxItems": 2,
"description": "The end point."
},
"startMarker": {
"type": "string",
"enum": ["none", "arrowhead"],
"description": "The marker at the start of the arrow.",
"default": "none"
},
"endMarker": {
"type": "string",
"enum": ["none", "arrowhead"],
"description": "The marker at the end of the arrow.",
"default": "none"
},
"relation": {
"type": "string",
"description": "The ID of the relation defining the semantics of the arrow."
}
},
"required": ["type", "start", "end"]
}
32 changes: 32 additions & 0 deletions spec/v0.7.1-draft/extensions/canvas-viewport.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "@ocif/canvas-viewport",
"description": "A viewport is a rectangle that defines at what part of a canvas the app should initially pan and zoom.",
"type": "object",
"properties": {
"position": {
"description": "The top-left corner of the viewport.",
"type": {
"type": "string",
"const": "@ocif/canvas-viewport"
},
"items": {
"type": "number"
},
"minItems": 2,
"maxItems": 3,
"default": [0, 0]
},
"size": {
"description": "The width and height (in 3D: also depth) of the viewport.",
"type": "array",
"items": {
"type": "number"
},
"minItems": 2,
"maxItems": 3,
"default": [100, 100]
}
},
"required": ["type","position", "size"]
}
14 changes: 14 additions & 0 deletions spec/v0.7.1-draft/extensions/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "@ocif/data",
"description": "Generic data extension. Used for round-tripping data with no OCIF semantics.",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "@ocif/data",
"description": "Identifies the data extension."
}
},
"required": [ "type" ]
}
35 changes: 35 additions & 0 deletions spec/v0.7.1-draft/extensions/edge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "@ocif/edge",
"description": "Edge relation extension",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "@ocif/edge",
"description": "Identifies the edge relation extension."
},
"start": {
"type": "string",
"description": "ID of start (source) element."
},
"end": {
"type": "string",
"description": "ID of end (target) element."
},
"directed": {
"type": "boolean",
"description": "Is the edge directed?",
"default": true
},
"rel": {
"type": "string",
"description": "Represented relation type. Can be a URI to represent the predicate of an RDF triple."
},
"node": {
"type": "string",
"description": "The ID of a node that visually represents the edge."
}
},
"required": ["type", "start", "end"]
}
34 changes: 34 additions & 0 deletions spec/v0.7.1-draft/extensions/global-positions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "@ocif/global-positions",
"description": "Global node coordinates",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "@ocif/global-positions"
},
"globalPosition": {
"type": "array",
"description": "Global coordinate as (x,y) or (x,y,z).",
"items": {
"type": "number"
},
"default": [0, 0]
},
"globalSize": {
"type": "array",
"description": "The global size of the node per dimension.",
"items": {
"type": "number"
},
"default": [100, 100]
},
"globalRotation": {
"type": "number",
"description": "+/- 360 degrees",
"default": 0
}
},
"required": ["type","globalPosition","globalSize","globalRotation"]
}
27 changes: 27 additions & 0 deletions spec/v0.7.1-draft/extensions/group.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "@ocif/group",
"description": "Group relation extension",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "@ocif/group",
"description": "Identifies the group relation extension."
},
"members": {
"type": "array",
"description": "IDs of members of the group",
"items": {
"description": "node ID or relation ID",
"type": "string"
}
},
"cascadeDelete": {
"type": "boolean",
"description": "If true, deleting the group will delete all members. Default is true.",
"default": true
}
},
"required": ["type", "members"]
}
46 changes: 46 additions & 0 deletions spec/v0.7.1-draft/extensions/hyperedge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "@ocif/hyperedge",
"description": "Hyperedge relation extension",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "@ocif/hyperedge"
},
"endpoints": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "ID of attached entity (node or relation)"
},
"direction": {
"type": "string",
"description": "Direction of the connection: 'in' (edge is going into the hyper-edge), 'out' (edge is going out from thy hyper-edge), 'undir' (edge is attached undirected). This is the default.",
"enum": ["in", "out", "undir"],
"default": "undir"
},
"weight": {
"type": "number",
"description": "Weight of the edge",
"default": 1.0
}
},
"required": ["id"]
}
},
"weight": {
"type": "number",
"description": "Weight of the edge. A floating-point number, which can be used to model the strength of the connection, as a whole. More general than endpoint-specific weights, and often sufficient.",
"default": 1.0
},
"rel": {
"type": "string",
"description": "Represented relation type"
}
},
"required": ["type", "endpoints"]
}
31 changes: 31 additions & 0 deletions spec/v0.7.1-draft/extensions/inherit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "@ocif/inherit",
"description": "Parent-child relationship extension. A parent-child relation models a hierarchical relationship between nodes. It can be used to model inheritance, containment, or other hierarchical relationships.",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "@ocif/inherit"
},
"inheritFrom": {
"type": "string",
"description": "ID of the source node. "
},
"child": {
"type": "string",
"description": "ID of the child node. A parent can have multiple children (expressed my multiple parent-child relations)."
},
"inherit": {
"type": "boolean",
"description": "Inherit properties. A boolean flag indicating if the child should inherit properties from the parent. Default is false. The exact semantics of inheritance are defined by the application. In general, when looking for JSON properties of a node and finding them undefined, an app should look for the same value in the parent node. This chain of parents should be followed until root is reached or a cycle is detected.",
"default": false
},
"cascadeDelete": {
"type": "boolean",
"description": "A boolean flag indicating if the children should be deleted when the parent is deleted.",
"default": true
}
},
"required": ["type", "child"]
}
Loading
Loading