-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassembly.schema.json
More file actions
198 lines (198 loc) · 10.3 KB
/
Copy pathassembly.schema.json
File metadata and controls
198 lines (198 loc) · 10.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://wiresketch.dev/schemas/assembly-1.0.schema.json",
"title": "WireSketch assembly description",
"description": "PCB instances, interface-to-interface connections, pin mappings, and diagram layout.",
"type": "object",
"additionalProperties": false,
"required": ["schema", "schemaVersion", "kind", "version", "id", "name", "layout", "nodes", "connections", "embeddedBoards"],
"properties": {
"schema": { "const": "urn:wiresketch:schema:assembly:1.0", "description": "Stable format identifier. Never translate or modify it." },
"schemaVersion": { "const": "1.6.0", "description": "The only supported assembly format version." },
"kind": { "const": "wiresketch/assembly" },
"version": { "const": 1 },
"id": { "$ref": "#/$defs/id" },
"name": { "type": "string", "minLength": 1, "maxLength": 120 },
"description": { "type": "string", "default": "" },
"layout": { "$ref": "#/$defs/layout" },
"canvasSize": { "$ref": "#/$defs/canvasSize" },
"textDefaults": { "$ref": "#/$defs/textStyle" },
"texts": { "type": "array", "items": { "$ref": "#/$defs/freeText" }, "default": [] },
"wireDefaults": { "$ref": "#/$defs/wireDefaults" },
"nodes": {
"type": "array",
"description": "Board instances. Multiple nodes may reference the same boardId.",
"items": { "$ref": "#/$defs/node" }
},
"connections": {
"type": "array",
"description": "Directed records used to define endpoint and pin-map orientation; electrical flow may still be bidirectional.",
"items": { "$ref": "#/$defs/connection" }
},
"embeddedBoards": {
"type": "array",
"description": "Self-contained PCB definitions referenced by nodes[].boardId. Include each board definition once.",
"items": { "$ref": "pcb-1.0.schema.json" }
}
},
"$defs": {
"id": { "type": "string", "minLength": 1, "maxLength": 160, "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$" },
"layout": {
"type": "object",
"additionalProperties": false,
"required": ["origin", "axisX", "axisY", "unit", "routing"],
"properties": {
"origin": { "const": "top-left" },
"axisX": { "const": "right" },
"axisY": { "const": "down" },
"unit": { "const": "diagram-px" },
"routing": { "enum": ["hybrid", "orthogonal", "manual"], "description": "hybrid prefers clear diagonal wire bundles and falls back to obstacle-avoiding orthogonal routes." }
}
},
"canvasSize": {
"type": "object",
"additionalProperties": false,
"required": ["width", "height"],
"properties": {
"width": { "type": "number", "minimum": 600, "maximum": 3000, "default": 1200 },
"height": { "type": "number", "minimum": 400, "maximum": 2000, "default": 800 }
}
},
"node": {
"type": "object",
"additionalProperties": false,
"required": ["id", "boardId", "label", "x", "y"],
"properties": {
"id": { "$ref": "#/$defs/id", "description": "Unique instance ID inside this assembly." },
"boardId": { "$ref": "#/$defs/id", "description": "References embeddedBoards[].id, not another node ID." },
"label": { "type": "string", "minLength": 1, "maxLength": 120, "description": "Instance label; it may differ from the board definition name." },
"x": { "type": "number", "description": "Left coordinate in diagram-px." },
"y": { "type": "number", "description": "Top coordinate in diagram-px." },
"rotation": { "type": "integer", "enum": [0, 90, 180, 270], "default": 0, "description": "Clockwise rotation of this PCB instance." },
"flipX": { "type": "boolean", "default": false, "description": "Mirrors this PCB instance horizontally in its local, unrotated coordinate system." },
"scale": { "type": "number", "minimum": 0.5, "maximum": 2, "default": 1, "description": "Visual scale of this PCB instance. Image, interfaces, pins, routing anchors, and export output scale together." },
"fixed": { "type": "boolean", "default": false, "description": "Prevents this board instance from being dragged or moved by automatic layout." },
"showName": { "type": "boolean", "default": true, "description": "Controls whether this board instance label is shown on the assembly canvas and in image exports." },
"nameOffset": { "$ref": "#/$defs/nameOffset" },
"nameStyle": { "$ref": "#/$defs/textStyle" },
"interfaceLabelGaps": {
"type": "object",
"description": "Optional spacing added between adjacent signal-name labels, keyed by interface ID for this board instance; wire paths are unaffected.",
"additionalProperties": { "type": "number", "minimum": 0, "maximum": 24 }
},
"interfaceConnectionModes": {
"type": "object",
"description": "Optional per-interface assembly connection mode keyed by interface ID. Omitted interfaces use bundle mode.",
"additionalProperties": { "const": "signal" }
}
}
},
"nameOffset": {
"type": "object",
"additionalProperties": false,
"required": ["x", "y"],
"description": "Draggable board-name position relative to the center of the rendered board image, in diagram-px.",
"properties": {
"x": { "type": "number", "minimum": -3000, "maximum": 3000 },
"y": { "type": "number", "minimum": -3000, "maximum": 3000 }
}
},
"textStyle": {
"type": "object",
"additionalProperties": false,
"required": ["fontSize", "fontFamily", "color"],
"properties": {
"fontSize": { "type": "number", "minimum": 8, "maximum": 72 },
"fontFamily": { "enum": ["sans-serif", "serif", "monospace", "Arial", "Helvetica", "Verdana", "Tahoma", "Georgia", "TimesNewRoman", "CourierNew", "MicrosoftYaHei", "PingFangSC", "NotoSansSC", "SimHei", "SimSun", "KaiTi", "FangSong"] },
"fontWeight": { "enum": [300, 400, 500, 600, 700, 800, 900], "default": 500 },
"color": { "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" },
"shadow": { "$ref": "#/$defs/textShadow" }
}
},
"textShadow": {
"type": "object",
"additionalProperties": false,
"required": ["enabled", "color", "blur", "offsetX", "offsetY"],
"properties": {
"enabled": { "type": "boolean" },
"color": { "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" },
"blur": { "type": "number", "minimum": 0, "maximum": 12 },
"offsetX": { "type": "number", "minimum": -10, "maximum": 10 },
"offsetY": { "type": "number", "minimum": -10, "maximum": 10 }
}
},
"freeText": {
"type": "object",
"additionalProperties": false,
"required": ["id", "text", "x", "y"],
"properties": {
"id": { "$ref": "#/$defs/id" },
"role": { "enum": ["title"], "description": "Optional semantic label; title text behaves exactly like other free text." },
"text": { "type": "string", "maxLength": 500 },
"x": { "type": "number" },
"y": { "type": "number" },
"style": { "$ref": "#/$defs/textStyle" }
}
},
"endpoint": {
"type": "object",
"additionalProperties": false,
"required": ["nodeId", "interfaceId"],
"properties": {
"nodeId": { "$ref": "#/$defs/id", "description": "References nodes[].id." },
"interfaceId": { "$ref": "#/$defs/id", "description": "References the selected node's PCB interfaces[].id." }
}
},
"pinPair": {
"type": "object",
"additionalProperties": false,
"required": ["from", "to"],
"properties": {
"from": { "type": "integer", "minimum": 1, "description": "1-based physical pin number on the from endpoint." },
"to": { "type": "integer", "minimum": 1, "description": "1-based physical pin number on the to endpoint." },
"label": { "type": "string", "maxLength": 80, "default": "", "description": "Optional custom name rendered at the middle of this signal wire." },
"style": { "$ref": "#/$defs/signalStyle" }
}
},
"wireDefaults": {
"type": "object",
"additionalProperties": false,
"properties": {
"width": { "type": "number", "minimum": 1, "maximum": 8, "default": 1.5 },
"labelGap": { "type": "number", "minimum": 0, "maximum": 24, "default": 0, "description": "Default spacing added between adjacent signal-name labels; wire paths are unaffected." },
"routeGap": { "type": "number", "minimum": 0, "maximum": 20, "default": 6, "description": "Default spacing between routed signal wires in the same connection bundle. Zero allows coincident routes." },
"cornerRadius": { "type": "number", "minimum": 0, "maximum": 24, "default": 6, "description": "Default radius for rounded polyline corners. Zero preserves sharp corners." },
"showFromLabels": { "type": "boolean", "default": true },
"showToLabels": { "type": "boolean", "default": true }
}
},
"signalStyle": {
"type": "object",
"additionalProperties": false,
"properties": {
"width": { "type": "number", "minimum": 1, "maximum": 8 },
"cornerRadius": { "type": "number", "minimum": 0, "maximum": 24 },
"showFromLabels": { "type": "boolean" },
"showToLabels": { "type": "boolean" }
}
},
"connection": {
"type": "object",
"additionalProperties": false,
"required": ["id", "description", "from", "to", "pinMap"],
"properties": {
"id": { "$ref": "#/$defs/id" },
"mode": { "enum": ["bundle", "signal"], "default": "bundle", "description": "Bundle connections are created and deleted as a whole. Signal connections contain manually selected pin pairs that may be deleted individually." },
"description": { "type": "string", "default": "" },
"gap": { "type": "number", "minimum": 0, "maximum": 20, "description": "Optional routed wire spacing override for this connection bundle. Zero allows coincident routes." },
"from": { "$ref": "#/$defs/endpoint" },
"to": { "$ref": "#/$defs/endpoint" },
"pinMap": {
"type": "array",
"description": "Explicit 1-based wire mapping. An empty array means the connection exists but its physical wiring is unspecified.",
"items": { "$ref": "#/$defs/pinPair" }
}
}
}
}
}