planscript 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/LICENSE +19 -0
  2. package/README.md +277 -0
  3. package/dist/ast/types.d.ts +195 -0
  4. package/dist/ast/types.d.ts.map +1 -0
  5. package/dist/ast/types.js +5 -0
  6. package/dist/ast/types.js.map +1 -0
  7. package/dist/cli.d.ts +3 -0
  8. package/dist/cli.d.ts.map +1 -0
  9. package/dist/cli.js +100 -0
  10. package/dist/cli.js.map +1 -0
  11. package/dist/compiler.d.ts +30 -0
  12. package/dist/compiler.d.ts.map +1 -0
  13. package/dist/compiler.js +80 -0
  14. package/dist/compiler.js.map +1 -0
  15. package/dist/exporters/json.d.ts +13 -0
  16. package/dist/exporters/json.d.ts.map +1 -0
  17. package/dist/exporters/json.js +17 -0
  18. package/dist/exporters/json.js.map +1 -0
  19. package/dist/exporters/svg.d.ts +27 -0
  20. package/dist/exporters/svg.d.ts.map +1 -0
  21. package/dist/exporters/svg.js +684 -0
  22. package/dist/exporters/svg.js.map +1 -0
  23. package/dist/geometry/index.d.ts +13 -0
  24. package/dist/geometry/index.d.ts.map +1 -0
  25. package/dist/geometry/index.js +333 -0
  26. package/dist/geometry/index.js.map +1 -0
  27. package/dist/geometry/types.d.ts +34 -0
  28. package/dist/geometry/types.d.ts.map +1 -0
  29. package/dist/geometry/types.js +2 -0
  30. package/dist/geometry/types.js.map +1 -0
  31. package/dist/index.d.ts +10 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +20 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/lowering/index.d.ts +25 -0
  36. package/dist/lowering/index.d.ts.map +1 -0
  37. package/dist/lowering/index.js +217 -0
  38. package/dist/lowering/index.js.map +1 -0
  39. package/dist/parser/grammar.d.ts +168 -0
  40. package/dist/parser/grammar.d.ts.map +1 -0
  41. package/dist/parser/grammar.js +7341 -0
  42. package/dist/parser/grammar.js.map +1 -0
  43. package/dist/parser/index.d.ts +27 -0
  44. package/dist/parser/index.d.ts.map +1 -0
  45. package/dist/parser/index.js +26 -0
  46. package/dist/parser/index.js.map +1 -0
  47. package/dist/validation/index.d.ts +22 -0
  48. package/dist/validation/index.d.ts.map +1 -0
  49. package/dist/validation/index.js +243 -0
  50. package/dist/validation/index.js.map +1 -0
  51. package/examples/house-with-dimensions.svg +106 -0
  52. package/examples/house.json +478 -0
  53. package/examples/house.psc +86 -0
  54. package/examples/house.svg +57 -0
  55. package/package.json +54 -0
@@ -0,0 +1,243 @@
1
+ import { calculatePolygonArea } from '../geometry/index.js';
2
+ // ============================================================================
3
+ // Error Codes
4
+ // ============================================================================
5
+ export const ErrorCodes = {
6
+ POLYGON_NOT_CLOSED: 'E101',
7
+ POLYGON_SELF_INTERSECTING: 'E102',
8
+ POLYGON_TOO_FEW_POINTS: 'E103',
9
+ ROOM_OUTSIDE_FOOTPRINT: 'E130',
10
+ ROOMS_OVERLAP: 'E201',
11
+ OPENING_NOT_ON_WALL: 'E310',
12
+ OPENING_EXCEEDS_WALL: 'E311',
13
+ ROOM_NO_ACCESS: 'E420',
14
+ MIN_AREA_VIOLATION: 'E501',
15
+ ZERO_AREA: 'E502',
16
+ };
17
+ // ============================================================================
18
+ // Geometry Validation Helpers
19
+ // ============================================================================
20
+ function isPolygonClosed(points, epsilon = 1e-10) {
21
+ if (points.length < 3)
22
+ return false;
23
+ const first = points[0];
24
+ const last = points[points.length - 1];
25
+ // Polygons don't need to repeat the first point - they are implicitly closed
26
+ return true;
27
+ }
28
+ function polygonHasEnoughPoints(points) {
29
+ return points.length >= 3;
30
+ }
31
+ function isPointInPolygon(point, polygon) {
32
+ let inside = false;
33
+ const n = polygon.length;
34
+ for (let i = 0, j = n - 1; i < n; j = i++) {
35
+ const xi = polygon[i].x;
36
+ const yi = polygon[i].y;
37
+ const xj = polygon[j].x;
38
+ const yj = polygon[j].y;
39
+ if ((yi > point.y) !== (yj > point.y) && point.x < ((xj - xi) * (point.y - yi)) / (yj - yi) + xi) {
40
+ inside = !inside;
41
+ }
42
+ }
43
+ return inside;
44
+ }
45
+ function isPolygonInsidePolygon(inner, outer) {
46
+ // Check if all points of inner polygon are inside outer polygon
47
+ for (const point of inner) {
48
+ if (!isPointInPolygon(point, outer)) {
49
+ // Check if point is on the boundary
50
+ if (!isPointOnPolygonBoundary(point, outer)) {
51
+ return false;
52
+ }
53
+ }
54
+ }
55
+ return true;
56
+ }
57
+ function isPointOnPolygonBoundary(point, polygon, epsilon = 1e-10) {
58
+ const n = polygon.length;
59
+ for (let i = 0; i < n; i++) {
60
+ const j = (i + 1) % n;
61
+ const p1 = polygon[i];
62
+ const p2 = polygon[j];
63
+ // Check if point is on segment p1-p2
64
+ const d1 = Math.sqrt((point.x - p1.x) ** 2 + (point.y - p1.y) ** 2);
65
+ const d2 = Math.sqrt((point.x - p2.x) ** 2 + (point.y - p2.y) ** 2);
66
+ const d12 = Math.sqrt((p2.x - p1.x) ** 2 + (p2.y - p1.y) ** 2);
67
+ if (Math.abs(d1 + d2 - d12) < epsilon) {
68
+ return true;
69
+ }
70
+ }
71
+ return false;
72
+ }
73
+ function doPolygonsOverlap(poly1, poly2) {
74
+ // Simple check: if any vertex of one polygon is strictly inside the other
75
+ for (const point of poly1) {
76
+ if (isPointInPolygon(point, poly2) && !isPointOnPolygonBoundary(point, poly2)) {
77
+ return true;
78
+ }
79
+ }
80
+ for (const point of poly2) {
81
+ if (isPointInPolygon(point, poly1) && !isPointOnPolygonBoundary(point, poly1)) {
82
+ return true;
83
+ }
84
+ }
85
+ // Check for edge intersections
86
+ return doEdgesIntersect(poly1, poly2);
87
+ }
88
+ function doEdgesIntersect(poly1, poly2) {
89
+ const n1 = poly1.length;
90
+ const n2 = poly2.length;
91
+ for (let i = 0; i < n1; i++) {
92
+ const a1 = poly1[i];
93
+ const a2 = poly1[(i + 1) % n1];
94
+ for (let j = 0; j < n2; j++) {
95
+ const b1 = poly2[j];
96
+ const b2 = poly2[(j + 1) % n2];
97
+ if (segmentsIntersect(a1, a2, b1, b2)) {
98
+ return true;
99
+ }
100
+ }
101
+ }
102
+ return false;
103
+ }
104
+ function segmentsIntersect(a1, a2, b1, b2) {
105
+ const d1 = direction(b1, b2, a1);
106
+ const d2 = direction(b1, b2, a2);
107
+ const d3 = direction(a1, a2, b1);
108
+ const d4 = direction(a1, a2, b2);
109
+ if (((d1 > 0 && d2 < 0) || (d1 < 0 && d2 > 0)) && ((d3 > 0 && d4 < 0) || (d3 < 0 && d4 > 0))) {
110
+ return true;
111
+ }
112
+ return false;
113
+ }
114
+ function direction(p1, p2, p3) {
115
+ return (p3.x - p1.x) * (p2.y - p1.y) - (p2.x - p1.x) * (p3.y - p1.y);
116
+ }
117
+ // ============================================================================
118
+ // Validation Functions
119
+ // ============================================================================
120
+ function validatePolygons(lowered) {
121
+ const errors = [];
122
+ // Validate footprint
123
+ if (!polygonHasEnoughPoints(lowered.footprint)) {
124
+ errors.push({
125
+ code: ErrorCodes.POLYGON_TOO_FEW_POINTS,
126
+ message: 'Footprint polygon must have at least 3 points',
127
+ });
128
+ }
129
+ // Validate room polygons
130
+ for (const room of lowered.rooms) {
131
+ if (!polygonHasEnoughPoints(room.polygon)) {
132
+ errors.push({
133
+ code: ErrorCodes.POLYGON_TOO_FEW_POINTS,
134
+ message: `Room "${room.name}" polygon must have at least 3 points`,
135
+ room: room.name,
136
+ });
137
+ }
138
+ const area = calculatePolygonArea(room.polygon);
139
+ if (area === 0) {
140
+ errors.push({
141
+ code: ErrorCodes.ZERO_AREA,
142
+ message: `Room "${room.name}" has zero area`,
143
+ room: room.name,
144
+ });
145
+ }
146
+ }
147
+ return errors;
148
+ }
149
+ function validateInsideFootprint(lowered) {
150
+ const errors = [];
151
+ for (const room of lowered.rooms) {
152
+ if (!isPolygonInsidePolygon(room.polygon, lowered.footprint)) {
153
+ errors.push({
154
+ code: ErrorCodes.ROOM_OUTSIDE_FOOTPRINT,
155
+ message: `Room "${room.name}" is outside the footprint`,
156
+ room: room.name,
157
+ });
158
+ }
159
+ }
160
+ return errors;
161
+ }
162
+ function validateNoOverlap(lowered) {
163
+ const errors = [];
164
+ const rooms = lowered.rooms;
165
+ for (let i = 0; i < rooms.length; i++) {
166
+ for (let j = i + 1; j < rooms.length; j++) {
167
+ if (doPolygonsOverlap(rooms[i].polygon, rooms[j].polygon)) {
168
+ errors.push({
169
+ code: ErrorCodes.ROOMS_OVERLAP,
170
+ message: `Rooms "${rooms[i].name}" and "${rooms[j].name}" overlap`,
171
+ details: { room1: rooms[i].name, room2: rooms[j].name },
172
+ });
173
+ }
174
+ }
175
+ }
176
+ return errors;
177
+ }
178
+ function validateOpeningsOnWalls(geometry) {
179
+ const errors = [];
180
+ for (const opening of geometry.openings) {
181
+ const wall = geometry.walls.find((w) => w.id === opening.wallId);
182
+ if (!wall) {
183
+ errors.push({
184
+ code: ErrorCodes.OPENING_NOT_ON_WALL,
185
+ message: `Opening "${opening.id}" is not placed on a valid wall`,
186
+ details: { openingId: opening.id },
187
+ });
188
+ }
189
+ }
190
+ return errors;
191
+ }
192
+ function validateMinRoomArea(lowered) {
193
+ const errors = [];
194
+ for (const assertion of lowered.assertions) {
195
+ if (assertion.type === 'AssertionMinRoomArea') {
196
+ const room = lowered.rooms.find((r) => r.name === assertion.room);
197
+ if (room) {
198
+ const area = calculatePolygonArea(room.polygon);
199
+ if (area < assertion.minArea) {
200
+ errors.push({
201
+ code: ErrorCodes.MIN_AREA_VIOLATION,
202
+ message: `Room "${assertion.room}" area (${area.toFixed(2)}) is less than minimum (${assertion.minArea})`,
203
+ room: assertion.room,
204
+ details: { actual: area, minimum: assertion.minArea },
205
+ });
206
+ }
207
+ }
208
+ }
209
+ }
210
+ return errors;
211
+ }
212
+ // ============================================================================
213
+ // Main Validation Function
214
+ // ============================================================================
215
+ export function validate(lowered, geometry) {
216
+ const errors = [];
217
+ // Basic polygon validation
218
+ errors.push(...validatePolygons(lowered));
219
+ // Process assertions
220
+ for (const assertion of lowered.assertions) {
221
+ switch (assertion.type) {
222
+ case 'AssertionInsideFootprint':
223
+ errors.push(...validateInsideFootprint(lowered));
224
+ break;
225
+ case 'AssertionNoOverlap':
226
+ errors.push(...validateNoOverlap(lowered));
227
+ break;
228
+ case 'AssertionOpeningsOnWalls':
229
+ errors.push(...validateOpeningsOnWalls(geometry));
230
+ break;
231
+ case 'AssertionMinRoomArea':
232
+ // Handled separately to process all min area assertions
233
+ break;
234
+ case 'AssertionRoomsConnected':
235
+ // TODO: Implement connectivity check
236
+ break;
237
+ }
238
+ }
239
+ // Validate min room areas
240
+ errors.push(...validateMinRoomArea(lowered));
241
+ return errors;
242
+ }
243
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validation/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAa5D,+EAA+E;AAC/E,cAAc;AACd,+EAA+E;AAE/E,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,kBAAkB,EAAE,MAAM;IAC1B,yBAAyB,EAAE,MAAM;IACjC,sBAAsB,EAAE,MAAM;IAC9B,sBAAsB,EAAE,MAAM;IAC9B,aAAa,EAAE,MAAM;IACrB,mBAAmB,EAAE,MAAM;IAC3B,oBAAoB,EAAE,MAAM;IAC5B,cAAc,EAAE,MAAM;IACtB,kBAAkB,EAAE,MAAM;IAC1B,SAAS,EAAE,MAAM;CACT,CAAC;AAEX,+EAA+E;AAC/E,8BAA8B;AAC9B,+EAA+E;AAE/E,SAAS,eAAe,CAAC,MAAe,EAAE,OAAO,GAAG,KAAK;IACvD,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IACpC,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACxB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACvC,6EAA6E;IA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SAAS,CAAC,OAAO,EAAE;qBACtD,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,+EAA+E;AAC/E,2BAA2B;AAC3B,+EAA+E;AAE/E,MAAM,UAAU,QAAQ,CAAC,OAAuB,EAAE,QAAoB;IACpE,MAAM,MAAM,GAAsB,EAAE,CAAC;IAErC,2BAA2B;IAC3B,MAAM,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;IAE1C,qBAAqB;IACrB,KAAK,MAAM,SAAS,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;QAC3C,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;YACvB,KAAK,0BAA0B;gBAC7B,MAAM,CAAC,IAAI,CAAC,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC,CAAC;gBACjD,MAAM;YACR,KAAK,oBAAoB;gBACvB,MAAM,CAAC,IAAI,CAAC,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;gBAC3C,MAAM;YACR,KAAK,0BAA0B;gBAC7B,MAAM,CAAC,IAAI,CAAC,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAClD,MAAM;YACR,KAAK,sBAAsB;gBACzB,wDAAwD;gBACxD,MAAM;YACR,KAAK,yBAAyB;gBAC5B,qCAAqC;gBACrC,MAAM;QACV,CAAC;IACH,CAAC;IAED,0BAA0B;IAC1B,MAAM,CAAC,IAAI,CAAC,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC;IAE7C,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,106 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg xmlns="http://www.w3.org/2000/svg" width="1000" height="800" viewBox="0 0 1000 800">
3
+ <defs>
4
+ <style>
5
+ .room-label { font-family: Arial, sans-serif; font-weight: 500; }
6
+ </style>
7
+ </defs>
8
+
9
+ <!-- Background -->
10
+ <rect width="1000" height="800" fill="#ffffff" />
11
+
12
+ <!-- Footprint (boundary) -->
13
+ <path d="M 346.67 630.00 L 653.33 630.00 L 653.33 170.00 L 346.67 170.00 Z" fill="none" stroke="#7f8c8d" stroke-width="2" stroke-dasharray="8,4" />
14
+
15
+ <!-- Rooms -->
16
+ <path d="M 362.00 614.67 L 484.67 614.67 L 484.67 522.67 L 362.00 522.67 Z" fill="#ecf0f1" stroke="#bdc3c7" stroke-width="1" />
17
+ <path d="M 484.67 614.67 L 546.00 614.67 L 546.00 522.67 L 484.67 522.67 Z" fill="#ecf0f1" stroke="#bdc3c7" stroke-width="1" />
18
+ <path d="M 362.00 522.67 L 546.00 522.67 L 546.00 492.00 L 362.00 492.00 Z" fill="#ecf0f1" stroke="#bdc3c7" stroke-width="1" />
19
+ <path d="M 362.00 492.00 L 417.20 492.00 L 417.20 430.67 L 362.00 430.67 Z" fill="#ecf0f1" stroke="#bdc3c7" stroke-width="1" />
20
+ <path d="M 417.20 464.40 L 457.07 464.40 L 457.07 430.67 L 417.20 430.67 Z" fill="#ecf0f1" stroke="#bdc3c7" stroke-width="1" />
21
+
22
+ <!-- Walls -->
23
+ <line x1="484.67" y1="614.67" x2="484.67" y2="522.67" stroke="#2c3e50" stroke-width="3" stroke-linecap="round" />
24
+ <line x1="362.00" y1="522.67" x2="484.67" y2="522.67" stroke="#2c3e50" stroke-width="3" stroke-linecap="round" />
25
+ <line x1="484.67" y1="522.67" x2="546.00" y2="522.67" stroke="#2c3e50" stroke-width="3" stroke-linecap="round" />
26
+ <line x1="362.00" y1="492.00" x2="417.20" y2="492.00" stroke="#2c3e50" stroke-width="3" stroke-linecap="round" />
27
+ <line x1="417.20" y1="464.40" x2="417.20" y2="430.67" stroke="#2c3e50" stroke-width="3" stroke-linecap="round" />
28
+ <line x1="362.00" y1="614.67" x2="484.67" y2="614.67" stroke="#2c3e50" stroke-width="3" stroke-linecap="round" />
29
+ <line x1="362.00" y1="614.67" x2="362.00" y2="522.67" stroke="#2c3e50" stroke-width="3" stroke-linecap="round" />
30
+ <line x1="484.67" y1="614.67" x2="546.00" y2="614.67" stroke="#2c3e50" stroke-width="3" stroke-linecap="round" />
31
+ <line x1="546.00" y1="614.67" x2="546.00" y2="522.67" stroke="#2c3e50" stroke-width="3" stroke-linecap="round" />
32
+ <line x1="546.00" y1="522.67" x2="546.00" y2="492.00" stroke="#2c3e50" stroke-width="3" stroke-linecap="round" />
33
+ <line x1="417.20" y1="492.00" x2="546.00" y2="492.00" stroke="#2c3e50" stroke-width="3" stroke-linecap="round" />
34
+ <line x1="362.00" y1="522.67" x2="362.00" y2="492.00" stroke="#2c3e50" stroke-width="3" stroke-linecap="round" />
35
+ <line x1="417.20" y1="492.00" x2="417.20" y2="464.40" stroke="#2c3e50" stroke-width="3" stroke-linecap="round" />
36
+ <line x1="362.00" y1="430.67" x2="417.20" y2="430.67" stroke="#2c3e50" stroke-width="3" stroke-linecap="round" />
37
+ <line x1="362.00" y1="492.00" x2="362.00" y2="430.67" stroke="#2c3e50" stroke-width="3" stroke-linecap="round" />
38
+ <line x1="417.20" y1="464.40" x2="457.07" y2="464.40" stroke="#2c3e50" stroke-width="3" stroke-linecap="round" />
39
+ <line x1="457.07" y1="464.40" x2="457.07" y2="430.67" stroke="#2c3e50" stroke-width="3" stroke-linecap="round" />
40
+ <line x1="417.20" y1="430.67" x2="457.07" y2="430.67" stroke="#2c3e50" stroke-width="3" stroke-linecap="round" />
41
+
42
+ <!-- Openings (doors/windows) -->
43
+ <line x1="428.70" y1="522.67" x2="442.50" y2="522.67" stroke="#e74c3c" stroke-width="4" stroke-linecap="round" />
44
+ <line x1="484.67" y1="575.57" x2="484.67" y2="561.77" stroke="#e74c3c" stroke-width="4" stroke-linecap="round" />
45
+ <line x1="382.70" y1="492.00" x2="396.50" y2="492.00" stroke="#e74c3c" stroke-width="4" stroke-linecap="round" />
46
+ <line x1="374.27" y1="614.67" x2="411.07" y2="614.67" stroke="#3498db" stroke-width="3" stroke-linecap="round" />
47
+
48
+ <!-- Labels -->
49
+ <text x="423.33" y="568.67" font-size="14" fill="#2c3e50" text-anchor="middle" dominant-baseline="middle" font-family="Arial, sans-serif">Living Room</text>
50
+ <text x="515.33" y="568.67" font-size="12" fill="#2c3e50" text-anchor="middle" dominant-baseline="middle" font-family="Arial, sans-serif">Kitchen</text>
51
+ <text x="454.00" y="507.33" font-size="12.266666666666667" fill="#2c3e50" text-anchor="middle" dominant-baseline="middle" font-family="Arial, sans-serif">Hallway</text>
52
+ <text x="389.60" y="461.33" font-size="6" fill="#2c3e50" text-anchor="middle" dominant-baseline="middle" font-family="Arial, sans-serif">Master Bedroom</text>
53
+ <text x="437.13" y="447.53" font-size="7" fill="#2c3e50" text-anchor="middle" dominant-baseline="middle" font-family="Arial, sans-serif">Bathroom</text>
54
+
55
+ <!-- Dimensions -->
56
+ <line x1="362.00" y1="634.67" x2="484.67" y2="634.67" stroke="#666666" stroke-width="1" />
57
+ <line x1="362.00" y1="628.67" x2="362.00" y2="640.67" stroke="#666666" stroke-width="1" />
58
+ <line x1="484.67" y1="628.67" x2="484.67" y2="640.67" stroke="#666666" stroke-width="1" />
59
+ <rect x="415.33" y="628.67" width="16.00" height="12.00" fill="#ffffff" />
60
+ <text x="423.33" y="634.67" font-size="10" fill="#666666" text-anchor="middle" dominant-baseline="middle" font-family="Arial, sans-serif">8m</text>
61
+ <line x1="484.67" y1="634.67" x2="546.00" y2="634.67" stroke="#666666" stroke-width="1" />
62
+ <line x1="484.67" y1="628.67" x2="484.67" y2="640.67" stroke="#666666" stroke-width="1" />
63
+ <line x1="546.00" y1="628.67" x2="546.00" y2="640.67" stroke="#666666" stroke-width="1" />
64
+ <rect x="507.33" y="628.67" width="16.00" height="12.00" fill="#ffffff" />
65
+ <text x="515.33" y="634.67" font-size="10" fill="#666666" text-anchor="middle" dominant-baseline="middle" font-family="Arial, sans-serif">4m</text>
66
+ <line x1="342.00" y1="614.67" x2="342.00" y2="522.67" stroke="#666666" stroke-width="1" />
67
+ <line x1="348.00" y1="614.67" x2="336.00" y2="614.67" stroke="#666666" stroke-width="1" />
68
+ <line x1="348.00" y1="522.67" x2="336.00" y2="522.67" stroke="#666666" stroke-width="1" />
69
+ <rect x="334.00" y="562.67" width="16.00" height="12.00" fill="#ffffff" transform="rotate(-90, 342.00, 568.67)" />
70
+ <text x="342.00" y="568.67" font-size="10" fill="#666666" text-anchor="middle" dominant-baseline="middle" font-family="Arial, sans-serif" transform="rotate(-90, 342.00, 568.67)">6m</text>
71
+ <line x1="342.00" y1="522.67" x2="342.00" y2="492.00" stroke="#666666" stroke-width="1" />
72
+ <line x1="348.00" y1="522.67" x2="336.00" y2="522.67" stroke="#666666" stroke-width="1" />
73
+ <line x1="348.00" y1="492.00" x2="336.00" y2="492.00" stroke="#666666" stroke-width="1" />
74
+ <rect x="334.00" y="501.33" width="16.00" height="12.00" fill="#ffffff" transform="rotate(-90, 342.00, 507.33)" />
75
+ <text x="342.00" y="507.33" font-size="10" fill="#666666" text-anchor="middle" dominant-baseline="middle" font-family="Arial, sans-serif" transform="rotate(-90, 342.00, 507.33)">2m</text>
76
+ <line x1="342.00" y1="492.00" x2="342.00" y2="430.67" stroke="#666666" stroke-width="1" />
77
+ <line x1="348.00" y1="492.00" x2="336.00" y2="492.00" stroke="#666666" stroke-width="1" />
78
+ <line x1="348.00" y1="430.67" x2="336.00" y2="430.67" stroke="#666666" stroke-width="1" />
79
+ <rect x="334.00" y="455.33" width="16.00" height="12.00" fill="#ffffff" transform="rotate(-90, 342.00, 461.33)" />
80
+ <text x="342.00" y="461.33" font-size="10" fill="#666666" text-anchor="middle" dominant-baseline="middle" font-family="Arial, sans-serif" transform="rotate(-90, 342.00, 461.33)">4m</text>
81
+ <line x1="362.00" y1="410.67" x2="417.20" y2="410.67" stroke="#666666" stroke-width="1" />
82
+ <line x1="362.00" y1="416.67" x2="362.00" y2="404.67" stroke="#666666" stroke-width="1" />
83
+ <line x1="417.20" y1="416.67" x2="417.20" y2="404.67" stroke="#666666" stroke-width="1" />
84
+ <rect x="375.60" y="404.67" width="28.00" height="12.00" fill="#ffffff" />
85
+ <text x="389.60" y="410.67" font-size="10" fill="#666666" text-anchor="middle" dominant-baseline="middle" font-family="Arial, sans-serif">3.6m</text>
86
+ <line x1="417.20" y1="410.67" x2="457.07" y2="410.67" stroke="#666666" stroke-width="1" />
87
+ <line x1="417.20" y1="416.67" x2="417.20" y2="404.67" stroke="#666666" stroke-width="1" />
88
+ <line x1="457.07" y1="416.67" x2="457.07" y2="404.67" stroke="#666666" stroke-width="1" />
89
+ <rect x="423.13" y="404.67" width="28.00" height="12.00" fill="#ffffff" />
90
+ <text x="437.13" y="410.67" font-size="10" fill="#666666" text-anchor="middle" dominant-baseline="middle" font-family="Arial, sans-serif">2.6m</text>
91
+ <line x1="477.07" y1="464.40" x2="477.07" y2="430.67" stroke="#666666" stroke-width="1" />
92
+ <line x1="471.07" y1="464.40" x2="483.07" y2="464.40" stroke="#666666" stroke-width="1" />
93
+ <line x1="471.07" y1="430.67" x2="483.07" y2="430.67" stroke="#666666" stroke-width="1" />
94
+ <rect x="463.07" y="441.53" width="28.00" height="12.00" fill="#ffffff" transform="rotate(-90, 477.07, 447.53)" />
95
+ <text x="477.07" y="447.53" font-size="10" fill="#666666" text-anchor="middle" dominant-baseline="middle" font-family="Arial, sans-serif" transform="rotate(-90, 477.07, 447.53)">2.2m</text>
96
+ <line x1="346.67" y1="680.00" x2="653.33" y2="680.00" stroke="#666666" stroke-width="1" />
97
+ <line x1="346.67" y1="674.00" x2="346.67" y2="686.00" stroke="#666666" stroke-width="1" />
98
+ <line x1="653.33" y1="674.00" x2="653.33" y2="686.00" stroke="#666666" stroke-width="1" />
99
+ <rect x="489.00" y="674.00" width="22.00" height="12.00" fill="#ffffff" />
100
+ <text x="500.00" y="680.00" font-size="10" fill="#666666" text-anchor="middle" dominant-baseline="middle" font-family="Arial, sans-serif">20m</text>
101
+ <line x1="296.67" y1="630.00" x2="296.67" y2="170.00" stroke="#666666" stroke-width="1" />
102
+ <line x1="302.67" y1="630.00" x2="290.67" y2="630.00" stroke="#666666" stroke-width="1" />
103
+ <line x1="302.67" y1="170.00" x2="290.67" y2="170.00" stroke="#666666" stroke-width="1" />
104
+ <rect x="285.67" y="394.00" width="22.00" height="12.00" fill="#ffffff" transform="rotate(-90, 296.67, 400.00)" />
105
+ <text x="296.67" y="400.00" font-size="10" fill="#666666" text-anchor="middle" dominant-baseline="middle" font-family="Arial, sans-serif" transform="rotate(-90, 296.67, 400.00)">30m</text>
106
+ </svg>