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