circuit-to-canvas 0.0.14 → 0.0.15
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.
- package/dist/index.d.ts +29 -29
- package/dist/index.js +157 -138
- package/lib/drawer/CircuitToCanvasDrawer.ts +21 -21
- package/lib/drawer/elements/pcb-board.ts +5 -5
- package/lib/drawer/elements/pcb-copper-pour.ts +13 -10
- package/lib/drawer/elements/pcb-copper-text.ts +4 -4
- package/lib/drawer/elements/pcb-cutout.ts +5 -5
- package/lib/drawer/elements/pcb-fabrication-note-path.ts +3 -3
- package/lib/drawer/elements/pcb-fabrication-note-rect.ts +3 -3
- package/lib/drawer/elements/pcb-fabrication-note-text.ts +4 -4
- package/lib/drawer/elements/pcb-hole.ts +8 -8
- package/lib/drawer/elements/pcb-note-line.ts +5 -5
- package/lib/drawer/elements/pcb-note-path.ts +3 -3
- package/lib/drawer/elements/pcb-note-rect.ts +3 -3
- package/lib/drawer/elements/pcb-note-text.ts +4 -4
- package/lib/drawer/elements/pcb-plated-hole.ts +14 -14
- package/lib/drawer/elements/pcb-silkscreen.ts +16 -16
- package/lib/drawer/elements/pcb-smtpad.ts +8 -8
- package/lib/drawer/elements/pcb-trace.ts +3 -3
- package/lib/drawer/elements/pcb-via.ts +4 -4
- package/lib/drawer/shapes/circle.ts +4 -4
- package/lib/drawer/shapes/line.ts +5 -5
- package/lib/drawer/shapes/oval.ts +13 -5
- package/lib/drawer/shapes/path.ts +8 -8
- package/lib/drawer/shapes/pill.ts +13 -5
- package/lib/drawer/shapes/polygon.ts +7 -7
- package/lib/drawer/shapes/rect.ts +7 -7
- package/lib/drawer/shapes/text.ts +5 -5
- package/lib/drawer/types.ts +1 -1
- package/package.json +1 -1
- package/tests/shapes/circle.test.ts +1 -1
- package/tests/shapes/oval.test.ts +1 -1
- package/tests/shapes/pill.test.ts +2 -2
- package/tests/shapes/rect.test.ts +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ interface CameraBounds {
|
|
|
81
81
|
}
|
|
82
82
|
interface DrawContext {
|
|
83
83
|
ctx: CanvasRenderingContext2D;
|
|
84
|
-
|
|
84
|
+
realToCanvasMat: Matrix;
|
|
85
85
|
colorMap: PcbColorMap;
|
|
86
86
|
}
|
|
87
87
|
|
|
@@ -110,7 +110,7 @@ interface DrawCircleParams {
|
|
|
110
110
|
};
|
|
111
111
|
radius: number;
|
|
112
112
|
fill: string;
|
|
113
|
-
|
|
113
|
+
realToCanvasMat: Matrix;
|
|
114
114
|
}
|
|
115
115
|
declare function drawCircle(params: DrawCircleParams): void;
|
|
116
116
|
|
|
@@ -123,7 +123,7 @@ interface DrawRectParams {
|
|
|
123
123
|
width: number;
|
|
124
124
|
height: number;
|
|
125
125
|
fill?: string;
|
|
126
|
-
|
|
126
|
+
realToCanvasMat: Matrix;
|
|
127
127
|
borderRadius?: number;
|
|
128
128
|
rotation?: number;
|
|
129
129
|
stroke?: string;
|
|
@@ -141,7 +141,7 @@ interface DrawOvalParams {
|
|
|
141
141
|
width: number;
|
|
142
142
|
height: number;
|
|
143
143
|
fill: string;
|
|
144
|
-
|
|
144
|
+
realToCanvasMat: Matrix;
|
|
145
145
|
rotation?: number;
|
|
146
146
|
}
|
|
147
147
|
declare function drawOval(params: DrawOvalParams): void;
|
|
@@ -155,7 +155,7 @@ interface DrawPillParams {
|
|
|
155
155
|
width: number;
|
|
156
156
|
height: number;
|
|
157
157
|
fill: string;
|
|
158
|
-
|
|
158
|
+
realToCanvasMat: Matrix;
|
|
159
159
|
rotation?: number;
|
|
160
160
|
}
|
|
161
161
|
declare function drawPill(params: DrawPillParams): void;
|
|
@@ -167,7 +167,7 @@ interface DrawPolygonParams {
|
|
|
167
167
|
y: number;
|
|
168
168
|
}>;
|
|
169
169
|
fill: string;
|
|
170
|
-
|
|
170
|
+
realToCanvasMat: Matrix;
|
|
171
171
|
}
|
|
172
172
|
declare function drawPolygon(params: DrawPolygonParams): void;
|
|
173
173
|
|
|
@@ -183,7 +183,7 @@ interface DrawLineParams {
|
|
|
183
183
|
};
|
|
184
184
|
strokeWidth: number;
|
|
185
185
|
stroke: string;
|
|
186
|
-
|
|
186
|
+
realToCanvasMat: Matrix;
|
|
187
187
|
lineCap?: "butt" | "round" | "square";
|
|
188
188
|
}
|
|
189
189
|
declare function drawLine(params: DrawLineParams): void;
|
|
@@ -197,7 +197,7 @@ interface DrawPathParams {
|
|
|
197
197
|
fill?: string;
|
|
198
198
|
stroke?: string;
|
|
199
199
|
strokeWidth?: number;
|
|
200
|
-
|
|
200
|
+
realToCanvasMat: Matrix;
|
|
201
201
|
closePath?: boolean;
|
|
202
202
|
}
|
|
203
203
|
declare function drawPath(params: DrawPathParams): void;
|
|
@@ -224,7 +224,7 @@ interface DrawTextParams {
|
|
|
224
224
|
y: number;
|
|
225
225
|
fontSize: number;
|
|
226
226
|
color: string;
|
|
227
|
-
|
|
227
|
+
realToCanvasMat: Matrix;
|
|
228
228
|
anchorAlignment: AnchorAlignment;
|
|
229
229
|
rotation?: number;
|
|
230
230
|
}
|
|
@@ -233,7 +233,7 @@ declare function drawText(params: DrawTextParams): void;
|
|
|
233
233
|
interface DrawPcbPlatedHoleParams {
|
|
234
234
|
ctx: CanvasContext;
|
|
235
235
|
hole: PcbPlatedHole;
|
|
236
|
-
|
|
236
|
+
realToCanvasMat: Matrix;
|
|
237
237
|
colorMap: PcbColorMap;
|
|
238
238
|
}
|
|
239
239
|
declare function drawPcbPlatedHole(params: DrawPcbPlatedHoleParams): void;
|
|
@@ -241,7 +241,7 @@ declare function drawPcbPlatedHole(params: DrawPcbPlatedHoleParams): void;
|
|
|
241
241
|
interface DrawPcbViaParams {
|
|
242
242
|
ctx: CanvasContext;
|
|
243
243
|
via: PCBVia;
|
|
244
|
-
|
|
244
|
+
realToCanvasMat: Matrix;
|
|
245
245
|
colorMap: PcbColorMap;
|
|
246
246
|
}
|
|
247
247
|
declare function drawPcbVia(params: DrawPcbViaParams): void;
|
|
@@ -249,7 +249,7 @@ declare function drawPcbVia(params: DrawPcbViaParams): void;
|
|
|
249
249
|
interface DrawPcbHoleParams {
|
|
250
250
|
ctx: CanvasContext;
|
|
251
251
|
hole: PCBHole;
|
|
252
|
-
|
|
252
|
+
realToCanvasMat: Matrix;
|
|
253
253
|
colorMap: PcbColorMap;
|
|
254
254
|
}
|
|
255
255
|
declare function drawPcbHole(params: DrawPcbHoleParams): void;
|
|
@@ -257,7 +257,7 @@ declare function drawPcbHole(params: DrawPcbHoleParams): void;
|
|
|
257
257
|
interface DrawPcbSmtPadParams {
|
|
258
258
|
ctx: CanvasContext;
|
|
259
259
|
pad: PcbSmtPad;
|
|
260
|
-
|
|
260
|
+
realToCanvasMat: Matrix;
|
|
261
261
|
colorMap: PcbColorMap;
|
|
262
262
|
}
|
|
263
263
|
declare function drawPcbSmtPad(params: DrawPcbSmtPadParams): void;
|
|
@@ -265,7 +265,7 @@ declare function drawPcbSmtPad(params: DrawPcbSmtPadParams): void;
|
|
|
265
265
|
interface DrawPcbTraceParams {
|
|
266
266
|
ctx: CanvasContext;
|
|
267
267
|
trace: PCBTrace;
|
|
268
|
-
|
|
268
|
+
realToCanvasMat: Matrix;
|
|
269
269
|
colorMap: PcbColorMap;
|
|
270
270
|
}
|
|
271
271
|
declare function drawPcbTrace(params: DrawPcbTraceParams): void;
|
|
@@ -273,7 +273,7 @@ declare function drawPcbTrace(params: DrawPcbTraceParams): void;
|
|
|
273
273
|
interface DrawPcbBoardParams {
|
|
274
274
|
ctx: CanvasContext;
|
|
275
275
|
board: PcbBoard;
|
|
276
|
-
|
|
276
|
+
realToCanvasMat: Matrix;
|
|
277
277
|
colorMap: PcbColorMap;
|
|
278
278
|
}
|
|
279
279
|
declare function drawPcbBoard(params: DrawPcbBoardParams): void;
|
|
@@ -281,31 +281,31 @@ declare function drawPcbBoard(params: DrawPcbBoardParams): void;
|
|
|
281
281
|
interface DrawPcbSilkscreenTextParams {
|
|
282
282
|
ctx: CanvasContext;
|
|
283
283
|
text: PcbSilkscreenText;
|
|
284
|
-
|
|
284
|
+
realToCanvasMat: Matrix;
|
|
285
285
|
colorMap: PcbColorMap;
|
|
286
286
|
}
|
|
287
287
|
interface DrawPcbSilkscreenRectParams {
|
|
288
288
|
ctx: CanvasContext;
|
|
289
289
|
rect: PcbSilkscreenRect;
|
|
290
|
-
|
|
290
|
+
realToCanvasMat: Matrix;
|
|
291
291
|
colorMap: PcbColorMap;
|
|
292
292
|
}
|
|
293
293
|
interface DrawPcbSilkscreenCircleParams {
|
|
294
294
|
ctx: CanvasContext;
|
|
295
295
|
circle: PcbSilkscreenCircle;
|
|
296
|
-
|
|
296
|
+
realToCanvasMat: Matrix;
|
|
297
297
|
colorMap: PcbColorMap;
|
|
298
298
|
}
|
|
299
299
|
interface DrawPcbSilkscreenLineParams {
|
|
300
300
|
ctx: CanvasContext;
|
|
301
301
|
line: PcbSilkscreenLine;
|
|
302
|
-
|
|
302
|
+
realToCanvasMat: Matrix;
|
|
303
303
|
colorMap: PcbColorMap;
|
|
304
304
|
}
|
|
305
305
|
interface DrawPcbSilkscreenPathParams {
|
|
306
306
|
ctx: CanvasContext;
|
|
307
307
|
path: PcbSilkscreenPath;
|
|
308
|
-
|
|
308
|
+
realToCanvasMat: Matrix;
|
|
309
309
|
colorMap: PcbColorMap;
|
|
310
310
|
}
|
|
311
311
|
declare function drawPcbSilkscreenText(params: DrawPcbSilkscreenTextParams): void;
|
|
@@ -317,7 +317,7 @@ declare function drawPcbSilkscreenPath(params: DrawPcbSilkscreenPathParams): voi
|
|
|
317
317
|
interface DrawPcbCutoutParams {
|
|
318
318
|
ctx: CanvasContext;
|
|
319
319
|
cutout: PcbCutout;
|
|
320
|
-
|
|
320
|
+
realToCanvasMat: Matrix;
|
|
321
321
|
colorMap: PcbColorMap;
|
|
322
322
|
}
|
|
323
323
|
declare function drawPcbCutout(params: DrawPcbCutoutParams): void;
|
|
@@ -325,7 +325,7 @@ declare function drawPcbCutout(params: DrawPcbCutoutParams): void;
|
|
|
325
325
|
interface DrawPcbCopperPourParams {
|
|
326
326
|
ctx: CanvasContext;
|
|
327
327
|
pour: PcbCopperPour;
|
|
328
|
-
|
|
328
|
+
realToCanvasMat: Matrix;
|
|
329
329
|
colorMap: PcbColorMap;
|
|
330
330
|
}
|
|
331
331
|
declare function drawPcbCopperPour(params: DrawPcbCopperPourParams): void;
|
|
@@ -333,7 +333,7 @@ declare function drawPcbCopperPour(params: DrawPcbCopperPourParams): void;
|
|
|
333
333
|
interface DrawPcbCopperTextParams {
|
|
334
334
|
ctx: CanvasContext;
|
|
335
335
|
text: PcbCopperText;
|
|
336
|
-
|
|
336
|
+
realToCanvasMat: Matrix;
|
|
337
337
|
colorMap: PcbColorMap;
|
|
338
338
|
}
|
|
339
339
|
declare function drawPcbCopperText(params: DrawPcbCopperTextParams): void;
|
|
@@ -341,7 +341,7 @@ declare function drawPcbCopperText(params: DrawPcbCopperTextParams): void;
|
|
|
341
341
|
interface DrawPcbFabricationNoteTextParams {
|
|
342
342
|
ctx: CanvasContext;
|
|
343
343
|
text: PcbFabricationNoteText;
|
|
344
|
-
|
|
344
|
+
realToCanvasMat: Matrix;
|
|
345
345
|
colorMap: PcbColorMap;
|
|
346
346
|
}
|
|
347
347
|
declare function drawPcbFabricationNoteText(params: DrawPcbFabricationNoteTextParams): void;
|
|
@@ -349,7 +349,7 @@ declare function drawPcbFabricationNoteText(params: DrawPcbFabricationNoteTextPa
|
|
|
349
349
|
interface DrawPcbFabricationNoteRectParams {
|
|
350
350
|
ctx: CanvasContext;
|
|
351
351
|
rect: PcbFabricationNoteRect;
|
|
352
|
-
|
|
352
|
+
realToCanvasMat: Matrix;
|
|
353
353
|
colorMap: PcbColorMap;
|
|
354
354
|
}
|
|
355
355
|
declare function drawPcbFabricationNoteRect(params: DrawPcbFabricationNoteRectParams): void;
|
|
@@ -357,7 +357,7 @@ declare function drawPcbFabricationNoteRect(params: DrawPcbFabricationNoteRectPa
|
|
|
357
357
|
interface DrawPcbNoteRectParams {
|
|
358
358
|
ctx: CanvasContext;
|
|
359
359
|
rect: PcbNoteRect;
|
|
360
|
-
|
|
360
|
+
realToCanvasMat: Matrix;
|
|
361
361
|
colorMap: PcbColorMap;
|
|
362
362
|
}
|
|
363
363
|
declare function drawPcbNoteRect(params: DrawPcbNoteRectParams): void;
|
|
@@ -365,7 +365,7 @@ declare function drawPcbNoteRect(params: DrawPcbNoteRectParams): void;
|
|
|
365
365
|
interface DrawPcbFabricationNotePathParams {
|
|
366
366
|
ctx: CanvasContext;
|
|
367
367
|
path: PcbFabricationNotePath;
|
|
368
|
-
|
|
368
|
+
realToCanvasMat: Matrix;
|
|
369
369
|
colorMap: PcbColorMap;
|
|
370
370
|
}
|
|
371
371
|
declare function drawPcbFabricationNotePath(params: DrawPcbFabricationNotePathParams): void;
|
|
@@ -373,7 +373,7 @@ declare function drawPcbFabricationNotePath(params: DrawPcbFabricationNotePathPa
|
|
|
373
373
|
interface DrawPcbNotePathParams {
|
|
374
374
|
ctx: CanvasContext;
|
|
375
375
|
path: PcbNotePath;
|
|
376
|
-
|
|
376
|
+
realToCanvasMat: Matrix;
|
|
377
377
|
colorMap: PcbColorMap;
|
|
378
378
|
}
|
|
379
379
|
declare function drawPcbNotePath(params: DrawPcbNotePathParams): void;
|
|
@@ -381,7 +381,7 @@ declare function drawPcbNotePath(params: DrawPcbNotePathParams): void;
|
|
|
381
381
|
interface DrawPcbNoteTextParams {
|
|
382
382
|
ctx: CanvasContext;
|
|
383
383
|
text: PcbNoteText;
|
|
384
|
-
|
|
384
|
+
realToCanvasMat: Matrix;
|
|
385
385
|
colorMap: PcbColorMap;
|
|
386
386
|
}
|
|
387
387
|
declare function drawPcbNoteText(params: DrawPcbNoteTextParams): void;
|