|
6 | 6 | }, |
7 | 7 | "properties": { |
8 | 8 | "edges": { |
| 9 | + "description": "Edges are lines that connect one node to another", |
9 | 10 | "items": { |
10 | 11 | "$ref": "#/definitions/JSONCanvasEdge" |
11 | 12 | }, |
12 | 13 | "type": "array" |
13 | 14 | }, |
14 | 15 | "nodes": { |
| 16 | + "description": "Nodes are objects within the canvas. Nodes may be text, files, links, or groups", |
15 | 17 | "items": { |
16 | 18 | "$ref": "#/definitions/JSONCanvasNode" |
17 | 19 | }, |
18 | 20 | "type": "array" |
19 | 21 | } |
20 | 22 | }, |
21 | | - "definitions": { |
| 23 | + "$defs": { |
22 | 24 | "JSONCanvasColor": { |
23 | 25 | "anyOf": [ |
24 | 26 | { |
25 | | - "type": "string" |
| 27 | + "description": "A color in hex format, e.g. #ff0000", |
| 28 | + "type": "string", |
| 29 | + "pattern": "^#[0-9a-fA-F]{6}$" |
26 | 30 | }, |
27 | 31 | { |
28 | 32 | "$ref": "#/definitions/JSONCanvasColorPreset" |
29 | 33 | } |
30 | 34 | ] |
31 | 35 | }, |
32 | 36 | "JSONCanvasColorPreset": { |
33 | | - "enum": [1, 2, 3, 4, 5, 6], |
34 | | - "type": "number" |
| 37 | + "title": "A preset color.", |
| 38 | + "description": "Six preset colors exist, mapped to the following numbers:\n1 red\n2 orange\n3 yellow\n4 green\n5 cyan\n6 purple", |
| 39 | + "enum": ["1", "2", "3", "4", "5", "6"], |
| 40 | + "type": "string" |
35 | 41 | }, |
36 | 42 | "JSONCanvasEdge": { |
37 | 43 | "additionalProperties": false, |
|
40 | 46 | "$ref": "#/definitions/JSONCanvasColor" |
41 | 47 | }, |
42 | 48 | "fromNode": { |
| 49 | + "description": "The ID of the node that the edge starts from", |
43 | 50 | "type": "string" |
44 | 51 | }, |
45 | 52 | "fromSide": { |
| 53 | + "description": "The side of the node that the edge connects from", |
46 | 54 | "$ref": "#/definitions/JSONCanvasEdgeSide" |
47 | 55 | }, |
48 | 56 | "id": { |
| 57 | + "description": "The ID for the edge", |
49 | 58 | "type": "string" |
50 | 59 | }, |
51 | 60 | "label": { |
| 61 | + "description": "The text label for the edge", |
52 | 62 | "type": "string" |
53 | 63 | }, |
54 | 64 | "toEnd": { |
55 | 65 | "$ref": "#/definitions/JSONCanvasEdgeEnd" |
56 | 66 | }, |
57 | 67 | "toNode": { |
| 68 | + "description": "The ID of the node that the edge ends at", |
58 | 69 | "type": "string" |
59 | 70 | }, |
60 | 71 | "toSide": { |
| 72 | + "description": "The side of the node that the edge connects to", |
61 | 73 | "$ref": "#/definitions/JSONCanvasEdgeSide" |
62 | 74 | } |
63 | 75 | }, |
64 | 76 | "required": ["id", "fromNode", "toNode"], |
65 | 77 | "type": "object" |
66 | 78 | }, |
67 | 79 | "JSONCanvasEdgeEnd": { |
| 80 | + "description": "The rendering style of the end of the edge line", |
68 | 81 | "enum": ["none", "arrow"], |
69 | 82 | "type": "string" |
70 | 83 | }, |
71 | 84 | "JSONCanvasEdgeSide": { |
| 85 | + "description": "The side of the node that the edge connects to", |
72 | 86 | "enum": ["top", "right", "bottom", "left"], |
73 | 87 | "type": "string" |
74 | 88 | }, |
|
79 | 93 | "$ref": "#/definitions/JSONCanvasColor" |
80 | 94 | }, |
81 | 95 | "file": { |
82 | | - "type": "string" |
| 96 | + "description": "The path to the file within the system", |
| 97 | + "type": "string", |
| 98 | + "minLength": 1 |
83 | 99 | }, |
84 | 100 | "height": { |
| 101 | + "description": "The height of the node in pixels", |
85 | 102 | "type": "number" |
86 | 103 | }, |
87 | 104 | "id": { |
| 105 | + "description": "Unique ID for the node", |
88 | 106 | "type": "string" |
89 | 107 | }, |
90 | 108 | "subpath": { |
| 109 | + "description": "The subpath that may link to a heading or a block. Always starts with a #", |
91 | 110 | "type": "string" |
92 | 111 | }, |
93 | 112 | "type": { |
| 113 | + "description": "The node type", |
94 | 114 | "const": "file", |
95 | 115 | "type": "string" |
96 | 116 | }, |
97 | 117 | "width": { |
| 118 | + "description": "The width of the node in pixels", |
98 | 119 | "type": "number" |
99 | 120 | }, |
100 | 121 | "x": { |
| 122 | + "description": "The x position of the node in pixels", |
101 | 123 | "type": "number" |
102 | 124 | }, |
103 | 125 | "y": { |
| 126 | + "description": "The y position of the node in pixels", |
104 | 127 | "type": "number" |
105 | 128 | } |
106 | 129 | }, |
|
111 | 134 | "additionalProperties": false, |
112 | 135 | "properties": { |
113 | 136 | "background": { |
| 137 | + "description": "The path to the background image", |
114 | 138 | "type": "string" |
115 | 139 | }, |
116 | 140 | "backgroundStyle": { |
| 141 | + "title": "The rendering style of a background image.", |
| 142 | + "description": "Options are:\ncover - fills the entire width and height of the node.\nratio - maintains the aspect ratio of the background image.\nrepeat - repeats the image as a pattern in both x/y directions.", |
117 | 143 | "enum": ["cover", "ratio", "repeat"], |
118 | 144 | "type": "string" |
119 | 145 | }, |
120 | 146 | "color": { |
121 | 147 | "$ref": "#/definitions/JSONCanvasColor" |
122 | 148 | }, |
123 | 149 | "height": { |
| 150 | + "description": "The height of the node in pixels", |
124 | 151 | "type": "number" |
125 | 152 | }, |
126 | 153 | "id": { |
| 154 | + "description": "Unique ID for the node", |
127 | 155 | "type": "string" |
128 | 156 | }, |
129 | 157 | "label": { |
| 158 | + "description": "The text label for the group", |
130 | 159 | "type": "string" |
131 | 160 | }, |
132 | 161 | "type": { |
| 162 | + "description": "The node type", |
133 | 163 | "const": "group", |
134 | 164 | "type": "string" |
135 | 165 | }, |
136 | 166 | "width": { |
| 167 | + "description": "The width of the node in pixels", |
137 | 168 | "type": "number" |
138 | 169 | }, |
139 | 170 | "x": { |
| 171 | + "description": "The x position of the node in pixels", |
140 | 172 | "type": "number" |
141 | 173 | }, |
142 | 174 | "y": { |
| 175 | + "description": "The y position of the node in pixels", |
143 | 176 | "type": "number" |
144 | 177 | } |
145 | 178 | }, |
|
153 | 186 | "$ref": "#/definitions/JSONCanvasColor" |
154 | 187 | }, |
155 | 188 | "height": { |
| 189 | + "description": "The height of the node in pixels", |
156 | 190 | "type": "number" |
157 | 191 | }, |
158 | 192 | "id": { |
| 193 | + "description": "Unique ID for the node", |
159 | 194 | "type": "string" |
160 | 195 | }, |
161 | 196 | "type": { |
| 197 | + "description": "The node type", |
162 | 198 | "const": "link", |
163 | 199 | "type": "string" |
164 | 200 | }, |
165 | 201 | "url": { |
166 | 202 | "type": "string" |
167 | 203 | }, |
168 | 204 | "width": { |
169 | | - "type": "integer" |
| 205 | + "description": "The width of the node in pixels", |
| 206 | + "type": "number" |
170 | 207 | }, |
171 | 208 | "x": { |
172 | | - "type": "integer" |
| 209 | + "description": "The x position of the node in pixels", |
| 210 | + "type": "number" |
173 | 211 | }, |
174 | 212 | "y": { |
| 213 | + "description": "The y position of the node in pixels", |
175 | 214 | "type": "number" |
176 | 215 | } |
177 | 216 | }, |
|
181 | 220 | "JSONCanvasNode": { |
182 | 221 | "anyOf": [ |
183 | 222 | { |
184 | | - "$ref": "#/definitions/JSONCanvasNodeType" |
| 223 | + "$ref": "#/definitions/JSONCanvasNodeGeneric" |
185 | 224 | }, |
186 | 225 | { |
187 | 226 | "$ref": "#/definitions/JSONCanvasTextNode" |
|
197 | 236 | } |
198 | 237 | ] |
199 | 238 | }, |
200 | | - "JSONCanvasNodeType": { |
| 239 | + "JSONCanvasNodeGeneric": { |
201 | 240 | "additionalProperties": false, |
202 | 241 | "properties": { |
203 | 242 | "color": { |
204 | 243 | "$ref": "#/definitions/JSONCanvasColor" |
205 | 244 | }, |
206 | 245 | "height": { |
| 246 | + "description": "The height of the node in pixels", |
207 | 247 | "type": "number" |
208 | 248 | }, |
209 | 249 | "id": { |
| 250 | + "description": "Unique ID for the node", |
210 | 251 | "type": "string" |
211 | 252 | }, |
212 | 253 | "type": { |
| 254 | + "description": "The node type", |
213 | 255 | "enum": ["text", "file", "link", "group"], |
214 | 256 | "type": "string" |
215 | 257 | }, |
216 | 258 | "width": { |
| 259 | + "description": "The width of the node in pixels", |
217 | 260 | "type": "number" |
218 | 261 | }, |
219 | 262 | "x": { |
| 263 | + "description": "The x position of the node in pixels", |
220 | 264 | "type": "number" |
221 | 265 | }, |
222 | 266 | "y": { |
| 267 | + "description": "The y position of the node in pixels", |
223 | 268 | "type": "number" |
224 | 269 | } |
225 | 270 | }, |
|
233 | 278 | "$ref": "#/definitions/JSONCanvasColor" |
234 | 279 | }, |
235 | 280 | "height": { |
236 | | - "type": "integer" |
| 281 | + "description": "The height of the node in pixels", |
| 282 | + "type": "number" |
237 | 283 | }, |
238 | 284 | "id": { |
| 285 | + "description": "Unique ID for the node", |
239 | 286 | "type": "string" |
240 | 287 | }, |
241 | 288 | "text": { |
| 289 | + "description": "Plain text with Markdown syntax", |
242 | 290 | "type": "string" |
243 | 291 | }, |
244 | 292 | "type": { |
| 293 | + "description": "The node type", |
245 | 294 | "const": "text", |
246 | 295 | "type": "string" |
247 | 296 | }, |
248 | 297 | "width": { |
249 | | - "type": "integer" |
| 298 | + "description": "The width of the node in pixels", |
| 299 | + "type": "number" |
250 | 300 | }, |
251 | 301 | "x": { |
252 | | - "type": "integer" |
| 302 | + "description": "The x position of the node in pixels", |
| 303 | + "type": "number" |
253 | 304 | }, |
254 | 305 | "y": { |
255 | | - "type": "integer" |
| 306 | + "description": "The y position of the node in pixels", |
| 307 | + "type": "number" |
256 | 308 | } |
257 | 309 | }, |
258 | 310 | "required": ["height", "id", "text", "type", "width", "x", "y"], |
|
0 commit comments