@operato/ocr 0.2.15 → 0.2.19

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 (44) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/demo/index.html +35 -25
  3. package/dist/src/camera-capturer.js +2 -2
  4. package/dist/src/camera-capturer.js.map +1 -1
  5. package/dist/src/index.d.ts +1 -1
  6. package/dist/src/index.js +1 -1
  7. package/dist/src/index.js.map +1 -1
  8. package/dist/src/ox-camera-capturer.d.ts +14 -0
  9. package/dist/src/ox-camera-capturer.js +178 -0
  10. package/dist/src/ox-camera-capturer.js.map +1 -0
  11. package/dist/src/{ocr-helper.d.ts → ox-ocr-helper.d.ts} +4 -2
  12. package/dist/src/{ocr-helper.js → ox-ocr-helper.js} +26 -25
  13. package/dist/src/ox-ocr-helper.js.map +1 -0
  14. package/dist/src/ox-ocr-result-image.d.ts +47 -0
  15. package/dist/src/ox-ocr-result-image.js +921 -0
  16. package/dist/src/ox-ocr-result-image.js.map +1 -0
  17. package/dist/src/utils/file-drop-helper.d.ts +16 -0
  18. package/dist/src/utils/file-drop-helper.js +47 -0
  19. package/dist/src/utils/file-drop-helper.js.map +1 -0
  20. package/dist/src/utils/touch-mouse-event.d.ts +0 -0
  21. package/dist/src/utils/touch-mouse-event.js +2 -0
  22. package/dist/src/utils/touch-mouse-event.js.map +1 -0
  23. package/dist/src/utils/touch-to-mouse-event.d.ts +1 -0
  24. package/dist/src/utils/touch-to-mouse-event.js +34 -0
  25. package/dist/src/utils/touch-to-mouse-event.js.map +1 -0
  26. package/dist/stories/index.stories.d.ts +1 -1
  27. package/dist/stories/index.stories.js +10 -14
  28. package/dist/stories/index.stories.js.map +1 -1
  29. package/dist/test/ox-ocr-helper.test.d.ts +1 -0
  30. package/dist/test/{ocr-helper.test.js → ox-ocr-helper.test.js} +7 -7
  31. package/dist/test/ox-ocr-helper.test.js.map +1 -0
  32. package/dist/tsconfig.tsbuildinfo +1 -1
  33. package/package.json +3 -2
  34. package/src/index.ts +1 -1
  35. package/src/{camera-capturer.ts → ox-camera-capturer.ts} +18 -10
  36. package/src/{ocr-helper.ts → ox-ocr-helper.ts} +27 -26
  37. package/src/ox-ocr-result-image.ts +954 -0
  38. package/src/{file-drop-helper.ts → utils/file-drop-helper.ts} +0 -0
  39. package/src/utils/touch-to-mouse-event.ts +39 -0
  40. package/stories/index.stories.ts +29 -37
  41. package/test/{ocr-helper.test.ts → ox-ocr-helper.test.ts} +8 -7
  42. package/dist/src/ocr-helper.js.map +0 -1
  43. package/dist/test/ocr-helper.test.d.ts +0 -1
  44. package/dist/test/ocr-helper.test.js.map +0 -1
@@ -0,0 +1,954 @@
1
+ import { css, html, LitElement, PropertyValues } from 'lit'
2
+ import { customElement, property, query, state } from 'lit/decorators.js'
3
+
4
+ import { touch2mouse } from './utils/touch-to-mouse-event'
5
+
6
+ type ScanResult = {
7
+ status_code: number
8
+ key_values: {
9
+ [key: string]: Array<string>
10
+ }
11
+ boundaries: Array<Array<{ x: number; y: number }>>
12
+ texts: Array<string>
13
+ }
14
+
15
+ @customElement('ox-ocr-result-image')
16
+ export class OcrResultImage extends LitElement {
17
+ static styles = [
18
+ css`
19
+ :host {
20
+ display: block;
21
+ position: relative;
22
+ }
23
+
24
+ img {
25
+ display: block;
26
+ flex: 1;
27
+ border: 0;
28
+ padding: 0;
29
+ margin: 0;
30
+ max-width: 100%;
31
+ max-height: 100%;
32
+ }
33
+
34
+ [overlay] {
35
+ position: absolute;
36
+ top: 0;
37
+ left: 0;
38
+ width: 100%;
39
+ height: 100%;
40
+
41
+ border: 0;
42
+ padding: 0;
43
+ margin: 0;
44
+ opacity: 50%;
45
+ }
46
+
47
+ [notice] {
48
+ position: absolute;
49
+ bottom: 0;
50
+ background-color: var(--primary-color, #38a25b);
51
+ padding: var(--padding-default, 9px) var(--padding-wide, 15px);
52
+ opacity: 0.95;
53
+
54
+ overflow-wrap: anywhere;
55
+
56
+ color: #fff;
57
+ font-size: 1.5em;
58
+ }
59
+ `
60
+ ]
61
+
62
+ @property({ type: Array }) file: any
63
+ @property({ type: Array }) result: ScanResult = RESULT
64
+
65
+ @state() _ratio!: { x: number; y: number }
66
+ @state() _image!: string
67
+ @state() _resizeObserver!: ResizeObserver
68
+ @state() _trails: Array<Array<{ x: number; y: number }>> = []
69
+ @state() _tracking: boolean = false
70
+ @state() _selections: Array<number> = []
71
+ @state() _text: string = ''
72
+
73
+ @query('img') _img!: HTMLImageElement
74
+ @query('[overlay]') _overlay!: HTMLCanvasElement
75
+
76
+ render() {
77
+ return html`
78
+ <img src=${this._image} />
79
+ <canvas overlay></canvas>
80
+
81
+ ${this._text ? html` <div notice>${this._text} copied!</div> ` : html``}
82
+ `
83
+ }
84
+
85
+ renderOverlay() {
86
+ const { boundaries } = this.result
87
+
88
+ const context = this._overlay.getContext('2d')
89
+ if (!context) {
90
+ return
91
+ }
92
+
93
+ context.save()
94
+
95
+ context.clearRect(0, 0, this._overlay.width, this._overlay.height)
96
+
97
+ context.lineWidth = 5
98
+ context.strokeStyle = 'red'
99
+ context.fillStyle = 'red'
100
+ context.lineJoin = 'round'
101
+ context.lineCap = 'round'
102
+
103
+ this._image &&
104
+ boundaries
105
+ .map((bounds): Array<{ x: number; y: number }> => {
106
+ return bounds.map(bound => {
107
+ return {
108
+ x: bound.x * this._ratio.x,
109
+ y: bound.y * this._ratio.y
110
+ }
111
+ })
112
+ })
113
+ .forEach((bounds, idx) => {
114
+ context.beginPath()
115
+ context.moveTo(bounds[0].x, bounds[0].y)
116
+ context.lineTo(bounds[1].x, bounds[1].y)
117
+ context.lineTo(bounds[2].x, bounds[2].y)
118
+ context.lineTo(bounds[3].x, bounds[3].y)
119
+ context.closePath()
120
+
121
+ if (this._selections.includes(idx)) {
122
+ context.fill()
123
+ }
124
+ context.stroke()
125
+ })
126
+
127
+ /* draw trails */
128
+ if (this._trails && this._trails.length > 0) {
129
+ context.lineWidth = 10
130
+ context.strokeStyle = 'blue'
131
+
132
+ context.beginPath()
133
+
134
+ this._trails.forEach(trail => {
135
+ if (trail && trail.length > 0) {
136
+ const { x, y } = trail[0]
137
+ context.moveTo(x, y)
138
+
139
+ trail.slice(1).forEach(point => {
140
+ const { x, y } = point
141
+ context.lineTo(x, y)
142
+ })
143
+ }
144
+ })
145
+
146
+ context.stroke()
147
+ }
148
+
149
+ context.restore()
150
+ }
151
+
152
+ async calculateRatio() {
153
+ const { naturalWidth, naturalHeight, offsetWidth, offsetHeight } = this._img
154
+
155
+ this._overlay.setAttribute('width', String(offsetWidth))
156
+ this._overlay.setAttribute('height', String(offsetHeight))
157
+
158
+ this._ratio = {
159
+ x: offsetWidth / naturalWidth,
160
+ y: offsetHeight / naturalHeight
161
+ }
162
+ }
163
+
164
+ async connectedCallback() {
165
+ await super.connectedCallback()
166
+
167
+ this._resizeObserver = new ResizeObserver(entries => {
168
+ this.calculateRatio()
169
+ this.renderOverlay()
170
+ })
171
+
172
+ await this.updateComplete
173
+ this._resizeObserver.observe(this._overlay)
174
+
175
+ this.calculateRatio()
176
+
177
+ this.addEventListener('mousedown', this.onTrailStart.bind(this) as EventListener)
178
+ this.addEventListener('mouseup', this.onTrailEnd.bind(this) as EventListener)
179
+ this.addEventListener('mousemove', this.onTrail.bind(this) as EventListener)
180
+ this.addEventListener('touchstart', touch2mouse as EventListener)
181
+ this.addEventListener('touchend', touch2mouse as EventListener)
182
+ this.addEventListener('touchmove', touch2mouse as EventListener)
183
+ }
184
+
185
+ disconnectedCallback() {
186
+ super.disconnectedCallback()
187
+
188
+ this._resizeObserver.disconnect()
189
+ }
190
+
191
+ async updated(changes: PropertyValues<this>) {
192
+ if (changes.has('file')) {
193
+ this._image = this.file && URL.createObjectURL(this.file)
194
+ if (this._image) {
195
+ requestAnimationFrame(() => URL.revokeObjectURL(this._image))
196
+ }
197
+ }
198
+
199
+ await this.updateComplete
200
+
201
+ this.renderOverlay()
202
+ }
203
+
204
+ findIndex(x: number, y: number): number {
205
+ x /= this._ratio.x
206
+ y /= this._ratio.y
207
+
208
+ const { boundaries } = this.result
209
+
210
+ return boundaries.findIndex(path => {
211
+ var result = false
212
+
213
+ path.forEach((p, idx) => {
214
+ let j = (idx + path.length + 1) % path.length
215
+
216
+ let x1 = p.x
217
+ let y1 = p.y
218
+ let x2 = path[j].x
219
+ let y2 = path[j].y
220
+
221
+ if (y1 > y != y2 > y && x < ((x2 - x1) * (y - y1)) / (y2 - y1) + x1) {
222
+ result = !result
223
+ }
224
+ })
225
+
226
+ return result
227
+ })
228
+ }
229
+
230
+ updateTrails(point: { x: number; y: number }, started: boolean, attached?: boolean) {
231
+ if (started && !attached) {
232
+ this._selections = []
233
+ this._trails = []
234
+ }
235
+
236
+ if (started) {
237
+ this._trails.push([])
238
+ }
239
+
240
+ var trail = this._trails[this._trails.length - 1]
241
+
242
+ trail.push(point)
243
+
244
+ this._trails.flat().forEach(({ x, y }) => {
245
+ const idx = this.findIndex(x, y)
246
+ if (idx === -1) {
247
+ return
248
+ }
249
+
250
+ if (!this._selections.includes(idx)) {
251
+ this._selections.push(idx)
252
+ }
253
+ })
254
+
255
+ this.requestUpdate()
256
+ }
257
+
258
+ onTrailStart(e: MouseEvent) {
259
+ const { offsetX: x, offsetY: y, button, shiftKey } = e
260
+
261
+ if (button !== 0) {
262
+ return
263
+ }
264
+
265
+ this._tracking = true
266
+ this.updateTrails({ x, y }, true, shiftKey)
267
+ }
268
+
269
+ onTrailEnd(e: MouseEvent) {
270
+ if (!this._tracking) {
271
+ return
272
+ }
273
+
274
+ this._text = this._selections.map(idx => this.result.texts[idx]).join('')
275
+
276
+ this.dispatchEvent(
277
+ new CustomEvent('selected', {
278
+ detail: this._text
279
+ })
280
+ )
281
+
282
+ this._tracking = false
283
+ }
284
+
285
+ onTrail(e: MouseEvent) {
286
+ const { offsetX: x, offsetY: y } = e
287
+
288
+ if (!this._tracking) {
289
+ return
290
+ }
291
+
292
+ this.updateTrails({ x, y }, false)
293
+ }
294
+ }
295
+
296
+ const RESULT = {
297
+ status_code: 200,
298
+ key_values: {
299
+ '1P': ['LNK304PG'],
300
+ Q: ['259', '311', '430'],
301
+ '9D': ['2139', '2139', '2135'],
302
+ '1T': ['BA268F', 'BA268C', 'BC488D']
303
+ },
304
+ boundaries: [
305
+ [
306
+ {
307
+ x: 217.0,
308
+ y: 117.0
309
+ },
310
+ {
311
+ x: 291.0,
312
+ y: 120.0
313
+ },
314
+ {
315
+ x: 291.0,
316
+ y: 143.0
317
+ },
318
+ {
319
+ x: 216.0,
320
+ y: 140.0
321
+ }
322
+ ],
323
+ [
324
+ {
325
+ x: 294.0,
326
+ y: 120.0
327
+ },
328
+ {
329
+ x: 442.0,
330
+ y: 129.0
331
+ },
332
+ {
333
+ x: 441.0,
334
+ y: 151.0
335
+ },
336
+ {
337
+ x: 292.0,
338
+ y: 143.0
339
+ }
340
+ ],
341
+ [
342
+ {
343
+ x: 443.0,
344
+ y: 130.0
345
+ },
346
+ {
347
+ x: 484.0,
348
+ y: 130.0
349
+ },
350
+ {
351
+ x: 484.0,
352
+ y: 151.0
353
+ },
354
+ {
355
+ x: 443.0,
356
+ y: 151.0
357
+ }
358
+ ],
359
+ [
360
+ {
361
+ x: 549.0,
362
+ y: 134.0
363
+ },
364
+ {
365
+ x: 642.0,
366
+ y: 138.0
367
+ },
368
+ {
369
+ x: 642.0,
370
+ y: 157.0
371
+ },
372
+ {
373
+ x: 548.0,
374
+ y: 152.0
375
+ }
376
+ ],
377
+ [
378
+ {
379
+ x: 255.0,
380
+ y: 163.0
381
+ },
382
+ {
383
+ x: 390.0,
384
+ y: 167.0
385
+ },
386
+ {
387
+ x: 389.0,
388
+ y: 191.0
389
+ },
390
+ {
391
+ x: 254.0,
392
+ y: 187.0
393
+ }
394
+ ],
395
+ [
396
+ {
397
+ x: 212.0,
398
+ y: 208.0
399
+ },
400
+ {
401
+ x: 255.0,
402
+ y: 208.0
403
+ },
404
+ {
405
+ x: 255.0,
406
+ y: 235.0
407
+ },
408
+ {
409
+ x: 212.0,
410
+ y: 235.0
411
+ }
412
+ ],
413
+ [
414
+ {
415
+ x: 257.0,
416
+ y: 210.0
417
+ },
418
+ {
419
+ x: 320.0,
420
+ y: 210.0
421
+ },
422
+ {
423
+ x: 320.0,
424
+ y: 232.0
425
+ },
426
+ {
427
+ x: 257.0,
428
+ y: 232.0
429
+ }
430
+ ],
431
+ [
432
+ {
433
+ x: 383.0,
434
+ y: 214.0
435
+ },
436
+ {
437
+ x: 480.0,
438
+ y: 218.0
439
+ },
440
+ {
441
+ x: 480.0,
442
+ y: 240.0
443
+ },
444
+ {
445
+ x: 383.0,
446
+ y: 236.0
447
+ }
448
+ ],
449
+ [
450
+ {
451
+ x: 215.0,
452
+ y: 301.0
453
+ },
454
+ {
455
+ x: 382.0,
456
+ y: 301.0
457
+ },
458
+ {
459
+ x: 382.0,
460
+ y: 325.0
461
+ },
462
+ {
463
+ x: 215.0,
464
+ y: 325.0
465
+ }
466
+ ],
467
+ [
468
+ {
469
+ x: 436.0,
470
+ y: 305.0
471
+ },
472
+ {
473
+ x: 539.0,
474
+ y: 305.0
475
+ },
476
+ {
477
+ x: 539.0,
478
+ y: 327.0
479
+ },
480
+ {
481
+ x: 436.0,
482
+ y: 327.0
483
+ }
484
+ ],
485
+ [
486
+ {
487
+ x: 537.0,
488
+ y: 308.0
489
+ },
490
+ {
491
+ x: 582.0,
492
+ y: 308.0
493
+ },
494
+ {
495
+ x: 582.0,
496
+ y: 328.0
497
+ },
498
+ {
499
+ x: 537.0,
500
+ y: 328.0
501
+ }
502
+ ],
503
+ [
504
+ {
505
+ x: 594.0,
506
+ y: 309.0
507
+ },
508
+ {
509
+ x: 624.0,
510
+ y: 309.0
511
+ },
512
+ {
513
+ x: 624.0,
514
+ y: 334.0
515
+ },
516
+ {
517
+ x: 594.0,
518
+ y: 334.0
519
+ }
520
+ ],
521
+ [
522
+ {
523
+ x: 624.0,
524
+ y: 310.0
525
+ },
526
+ {
527
+ x: 659.0,
528
+ y: 310.0
529
+ },
530
+ {
531
+ x: 659.0,
532
+ y: 330.0
533
+ },
534
+ {
535
+ x: 624.0,
536
+ y: 330.0
537
+ }
538
+ ],
539
+ [
540
+ {
541
+ x: 675.0,
542
+ y: 311.0
543
+ },
544
+ {
545
+ x: 707.0,
546
+ y: 311.0
547
+ },
548
+ {
549
+ x: 707.0,
550
+ y: 330.0
551
+ },
552
+ {
553
+ x: 675.0,
554
+ y: 330.0
555
+ }
556
+ ],
557
+ [
558
+ {
559
+ x: 735.0,
560
+ y: 342.0
561
+ },
562
+ {
563
+ x: 775.0,
564
+ y: 342.0
565
+ },
566
+ {
567
+ x: 775.0,
568
+ y: 360.0
569
+ },
570
+ {
571
+ x: 735.0,
572
+ y: 360.0
573
+ }
574
+ ],
575
+ [
576
+ {
577
+ x: 806.0,
578
+ y: 341.0
579
+ },
580
+ {
581
+ x: 829.0,
582
+ y: 341.0
583
+ },
584
+ {
585
+ x: 829.0,
586
+ y: 359.0
587
+ },
588
+ {
589
+ x: 806.0,
590
+ y: 359.0
591
+ }
592
+ ],
593
+ [
594
+ {
595
+ x: 217.0,
596
+ y: 386.0
597
+ },
598
+ {
599
+ x: 381.0,
600
+ y: 383.0
601
+ },
602
+ {
603
+ x: 381.0,
604
+ y: 407.0
605
+ },
606
+ {
607
+ x: 217.0,
608
+ y: 410.0
609
+ }
610
+ ],
611
+ [
612
+ {
613
+ x: 436.0,
614
+ y: 387.0
615
+ },
616
+ {
617
+ x: 536.0,
618
+ y: 387.0
619
+ },
620
+ {
621
+ x: 536.0,
622
+ y: 410.0
623
+ },
624
+ {
625
+ x: 436.0,
626
+ y: 410.0
627
+ }
628
+ ],
629
+ [
630
+ {
631
+ x: 535.0,
632
+ y: 388.0
633
+ },
634
+ {
635
+ x: 577.0,
636
+ y: 388.0
637
+ },
638
+ {
639
+ x: 577.0,
640
+ y: 407.0
641
+ },
642
+ {
643
+ x: 535.0,
644
+ y: 407.0
645
+ }
646
+ ],
647
+ [
648
+ {
649
+ x: 590.0,
650
+ y: 387.0
651
+ },
652
+ {
653
+ x: 617.0,
654
+ y: 387.0
655
+ },
656
+ {
657
+ x: 617.0,
658
+ y: 411.0
659
+ },
660
+ {
661
+ x: 590.0,
662
+ y: 411.0
663
+ }
664
+ ],
665
+ [
666
+ {
667
+ x: 618.0,
668
+ y: 388.0
669
+ },
670
+ {
671
+ x: 653.0,
672
+ y: 388.0
673
+ },
674
+ {
675
+ x: 653.0,
676
+ y: 409.0
677
+ },
678
+ {
679
+ x: 618.0,
680
+ y: 409.0
681
+ }
682
+ ],
683
+ [
684
+ {
685
+ x: 669.0,
686
+ y: 389.0
687
+ },
688
+ {
689
+ x: 702.0,
690
+ y: 389.0
691
+ },
692
+ {
693
+ x: 702.0,
694
+ y: 408.0
695
+ },
696
+ {
697
+ x: 669.0,
698
+ y: 408.0
699
+ }
700
+ ],
701
+ [
702
+ {
703
+ x: 728.0,
704
+ y: 416.0
705
+ },
706
+ {
707
+ x: 769.0,
708
+ y: 416.0
709
+ },
710
+ {
711
+ x: 769.0,
712
+ y: 436.0
713
+ },
714
+ {
715
+ x: 728.0,
716
+ y: 436.0
717
+ }
718
+ ],
719
+ [
720
+ {
721
+ x: 798.0,
722
+ y: 416.0
723
+ },
724
+ {
725
+ x: 822.0,
726
+ y: 416.0
727
+ },
728
+ {
729
+ x: 822.0,
730
+ y: 433.0
731
+ },
732
+ {
733
+ x: 798.0,
734
+ y: 433.0
735
+ }
736
+ ],
737
+ [
738
+ {
739
+ x: 219.0,
740
+ y: 465.0
741
+ },
742
+ {
743
+ x: 381.0,
744
+ y: 460.0
745
+ },
746
+ {
747
+ x: 382.0,
748
+ y: 482.0
749
+ },
750
+ {
751
+ x: 220.0,
752
+ y: 487.0
753
+ }
754
+ ],
755
+ [
756
+ {
757
+ x: 434.0,
758
+ y: 463.0
759
+ },
760
+ {
761
+ x: 534.0,
762
+ y: 461.0
763
+ },
764
+ {
765
+ x: 534.0,
766
+ y: 481.0
767
+ },
768
+ {
769
+ x: 435.0,
770
+ y: 483.0
771
+ }
772
+ ],
773
+ [
774
+ {
775
+ x: 532.0,
776
+ y: 462.0
777
+ },
778
+ {
779
+ x: 574.0,
780
+ y: 462.0
781
+ },
782
+ {
783
+ x: 574.0,
784
+ y: 479.0
785
+ },
786
+ {
787
+ x: 532.0,
788
+ y: 479.0
789
+ }
790
+ ],
791
+ [
792
+ {
793
+ x: 587.0,
794
+ y: 461.0
795
+ },
796
+ {
797
+ x: 614.0,
798
+ y: 461.0
799
+ },
800
+ {
801
+ x: 614.0,
802
+ y: 482.0
803
+ },
804
+ {
805
+ x: 587.0,
806
+ y: 482.0
807
+ }
808
+ ],
809
+ [
810
+ {
811
+ x: 616.0,
812
+ y: 461.0
813
+ },
814
+ {
815
+ x: 650.0,
816
+ y: 463.0
817
+ },
818
+ {
819
+ x: 649.0,
820
+ y: 481.0
821
+ },
822
+ {
823
+ x: 615.0,
824
+ y: 479.0
825
+ }
826
+ ],
827
+ [
828
+ {
829
+ x: 664.0,
830
+ y: 461.0
831
+ },
832
+ {
833
+ x: 697.0,
834
+ y: 461.0
835
+ },
836
+ {
837
+ x: 697.0,
838
+ y: 479.0
839
+ },
840
+ {
841
+ x: 664.0,
842
+ y: 479.0
843
+ }
844
+ ],
845
+ [
846
+ {
847
+ x: 723.0,
848
+ y: 486.0
849
+ },
850
+ {
851
+ x: 761.0,
852
+ y: 486.0
853
+ },
854
+ {
855
+ x: 761.0,
856
+ y: 504.0
857
+ },
858
+ {
859
+ x: 723.0,
860
+ y: 504.0
861
+ }
862
+ ],
863
+ [
864
+ {
865
+ x: 792.0,
866
+ y: 485.0
867
+ },
868
+ {
869
+ x: 814.0,
870
+ y: 485.0
871
+ },
872
+ {
873
+ x: 814.0,
874
+ y: 500.0
875
+ },
876
+ {
877
+ x: 792.0,
878
+ y: 500.0
879
+ }
880
+ ],
881
+ [
882
+ {
883
+ x: 586.0,
884
+ y: 535.0
885
+ },
886
+ {
887
+ x: 626.0,
888
+ y: 535.0
889
+ },
890
+ {
891
+ x: 626.0,
892
+ y: 551.0
893
+ },
894
+ {
895
+ x: 586.0,
896
+ y: 551.0
897
+ }
898
+ ],
899
+ [
900
+ {
901
+ x: 664.0,
902
+ y: 533.0
903
+ },
904
+ {
905
+ x: 700.0,
906
+ y: 533.0
907
+ },
908
+ {
909
+ x: 700.0,
910
+ y: 548.0
911
+ },
912
+ {
913
+ x: 664.0,
914
+ y: 548.0
915
+ }
916
+ ]
917
+ ],
918
+ texts: [
919
+ 'POWER',
920
+ 'INTEGRATIONS',
921
+ 'INC.',
922
+ '15/10/2021',
923
+ 'LinkSwitchTM',
924
+ '(1P)',
925
+ 'PROD:',
926
+ 'LNK304PG',
927
+ '(1T)LotNo:BA268F',
928
+ '(9D)DtCode:',
929
+ '2139',
930
+ '(Q)',
931
+ 'Qty:',
932
+ '259',
933
+ 'COO:',
934
+ 'CN',
935
+ '(1T)LotNo:BA268C',
936
+ '(9D)DtCode:',
937
+ '2139',
938
+ '(Q)',
939
+ 'Qty:',
940
+ '311',
941
+ 'COO:',
942
+ 'CN',
943
+ '(1T)LotNo:BC488D',
944
+ '(9D)DtCode:',
945
+ '2135',
946
+ '(Q)',
947
+ 'Qty:',
948
+ '430',
949
+ 'COO:',
950
+ 'CN',
951
+ 'Total',
952
+ '1000'
953
+ ]
954
+ }