@lumiscaphe/ng-viewer 14.0.0 → 16.0.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.
@@ -4,269 +4,269 @@ import { Viewer } from '@lumiscaphe/viewer';
4
4
  import * as i1 from '@angular/common';
5
5
  import { CommonModule } from '@angular/common';
6
6
 
7
- class Viewport {
8
- static fit(resolution, viewportWidth, viewportHeight, fit) {
9
- const aspectRatio = resolution.width / resolution.height;
10
- const viewportRatio = viewportWidth / viewportHeight;
11
- let width = 0;
12
- let height = 0;
13
- switch (fit) {
14
- case 'contain':
15
- width = viewportRatio < aspectRatio ? viewportWidth : viewportHeight * aspectRatio;
16
- height = viewportRatio < aspectRatio ? viewportWidth / aspectRatio : viewportHeight;
17
- break;
18
- case 'cover':
19
- default:
20
- width = viewportRatio < aspectRatio ? viewportHeight * aspectRatio : viewportWidth;
21
- height = viewportRatio < aspectRatio ? viewportHeight : viewportWidth / aspectRatio;
22
- break;
23
- case 'fill':
24
- width = viewportWidth;
25
- height = viewportHeight;
26
- break;
27
- }
28
- return {
29
- width: Math.round(width),
30
- height: Math.round(height),
31
- top: Math.round((viewportHeight - height) / 2),
32
- left: Math.round((viewportWidth - width) / 2),
33
- };
34
- }
35
- static getStandardAspectRatio(width, height) {
36
- if (width === 0 || height === 0) {
37
- return 0;
38
- }
39
- const aspectRatio = width / height;
40
- if (width < height) {
41
- const distanceTo34 = Math.abs(3 / 4 - aspectRatio);
42
- const distanceTo916 = Math.abs(9 / 16 - aspectRatio);
43
- return distanceTo34 < distanceTo916 ? 3 / 4 : 9 / 16;
44
- }
45
- const distanceTo43 = Math.abs(4 / 3 - aspectRatio);
46
- const distanceTo169 = Math.abs(16 / 9 - aspectRatio);
47
- return distanceTo43 < distanceTo169 ? 4 / 3 : 16 / 9;
48
- }
49
- static getStandardQuality(height) {
50
- if (height <= 240) {
51
- return 240;
52
- }
53
- if (height <= 360) {
54
- return 360;
55
- }
56
- if (height <= 480) {
57
- return 480;
58
- }
59
- if (height <= 720) {
60
- return 720;
61
- }
62
- return 1080;
63
- }
64
- static getStandardResolution(width, height) {
65
- if (width === 0 || height === 0) {
66
- return { width: 0, height: 0 };
67
- }
68
- const aspectRatio = Viewport.getStandardAspectRatio(width, height);
69
- if (width < height) {
70
- const quality = Viewport.getStandardQuality(height * aspectRatio);
71
- return { width: Math.round(quality), height: Math.round(quality / aspectRatio) };
72
- }
73
- const quality = Viewport.getStandardQuality(width / aspectRatio);
74
- return { width: Math.round(quality * aspectRatio), height: Math.round(quality) };
75
- }
7
+ class Viewport {
8
+ static fit(resolution, viewportWidth, viewportHeight, fit) {
9
+ const aspectRatio = resolution.width / resolution.height;
10
+ const viewportRatio = viewportWidth / viewportHeight;
11
+ let width = 0;
12
+ let height = 0;
13
+ switch (fit) {
14
+ case 'contain':
15
+ width = viewportRatio < aspectRatio ? viewportWidth : viewportHeight * aspectRatio;
16
+ height = viewportRatio < aspectRatio ? viewportWidth / aspectRatio : viewportHeight;
17
+ break;
18
+ case 'cover':
19
+ default:
20
+ width = viewportRatio < aspectRatio ? viewportHeight * aspectRatio : viewportWidth;
21
+ height = viewportRatio < aspectRatio ? viewportHeight : viewportWidth / aspectRatio;
22
+ break;
23
+ case 'fill':
24
+ width = viewportWidth;
25
+ height = viewportHeight;
26
+ break;
27
+ }
28
+ return {
29
+ width: Math.round(width),
30
+ height: Math.round(height),
31
+ top: Math.round((viewportHeight - height) / 2),
32
+ left: Math.round((viewportWidth - width) / 2),
33
+ };
34
+ }
35
+ static getStandardAspectRatio(width, height) {
36
+ if (width === 0 || height === 0) {
37
+ return 0;
38
+ }
39
+ const aspectRatio = width / height;
40
+ if (width < height) {
41
+ const distanceTo34 = Math.abs(3 / 4 - aspectRatio);
42
+ const distanceTo916 = Math.abs(9 / 16 - aspectRatio);
43
+ return distanceTo34 < distanceTo916 ? 3 / 4 : 9 / 16;
44
+ }
45
+ const distanceTo43 = Math.abs(4 / 3 - aspectRatio);
46
+ const distanceTo169 = Math.abs(16 / 9 - aspectRatio);
47
+ return distanceTo43 < distanceTo169 ? 4 / 3 : 16 / 9;
48
+ }
49
+ static getStandardQuality(height) {
50
+ if (height <= 240) {
51
+ return 240;
52
+ }
53
+ if (height <= 360) {
54
+ return 360;
55
+ }
56
+ if (height <= 480) {
57
+ return 480;
58
+ }
59
+ if (height <= 720) {
60
+ return 720;
61
+ }
62
+ return 1080;
63
+ }
64
+ static getStandardResolution(width, height) {
65
+ if (width === 0 || height === 0) {
66
+ return { width: 0, height: 0 };
67
+ }
68
+ const aspectRatio = Viewport.getStandardAspectRatio(width, height);
69
+ if (width < height) {
70
+ const quality = Viewport.getStandardQuality(height * aspectRatio);
71
+ return { width: Math.round(quality), height: Math.round(quality / aspectRatio) };
72
+ }
73
+ const quality = Viewport.getStandardQuality(width / aspectRatio);
74
+ return { width: Math.round(quality * aspectRatio), height: Math.round(quality) };
75
+ }
76
76
  }
77
77
 
78
- class NgViewerComponent {
79
- constructor() {
80
- this.hotspots = [];
81
- this.hotspotTemplateRef = null;
82
- this.onLoadStart = new EventEmitter();
83
- this.onLoadProgress = new EventEmitter();
84
- this.onLoadEnd = new EventEmitter();
85
- this.onLoadError = new EventEmitter();
86
- this.onInteraction = new EventEmitter();
87
- this.onVrcubeInteraction = new EventEmitter();
88
- this.onVrobjectInteraction = new EventEmitter();
89
- this.fitPosition = { width: 1, height: 1, top: 1, left: 1 };
90
- this.scaleX = 1;
91
- this.scaleY = 1;
92
- }
93
- ngAfterViewInit() {
94
- this.viewer = new Viewer(this.container.nativeElement, {
95
- server: this.server,
96
- api: this.api || 'v1',
97
- fit: this.fit || 'cover',
98
- events: {
99
- onLoadStart: (...args) => { this.onLoadStart.emit(...args); },
100
- onLoadProgress: (...args) => { this.onLoadProgress.emit(...args); },
101
- onLoadEnd: (...args) => { this.onLoadEnd.emit(...args); },
102
- onLoadError: (...args) => { this.onLoadError.emit(...args); },
103
- onInteraction: (...args) => { this.onInteraction.emit(...args); },
104
- onVrcubeInteraction: (...args) => { this.onVrcubeInteraction.emit(...args); },
105
- onVrobjectInteraction: (...args) => { this.onVrobjectInteraction.emit(...args); },
106
- onHotspotsChange: this.onHotspotsChange.bind(this)
107
- },
108
- });
109
- if (this['scene']) {
110
- this.viewer.load(this.scene).catch(() => { });
111
- }
112
- if (this['encoder']) {
113
- this.viewer.setEncoder(this.encoder).catch(() => { });
114
- }
115
- if (this.parameters) {
116
- this.viewer.setParameters(this.parameters).catch(() => { });
117
- }
118
- if (this.view) {
119
- this.viewer.setView(this.view).catch(() => { });
120
- }
121
- if (this.vrcube) {
122
- this.viewer.setVrcube(this.vrcube);
123
- }
124
- if (this.vrobject) {
125
- this.viewer.setVrobject(this.vrobject);
126
- }
127
- if (this.tags) {
128
- this.viewer.setTags(this.tags);
129
- }
130
- this.onResize();
131
- }
132
- ngOnDestroy() {
133
- this.viewer?.destroy();
134
- }
135
- ngOnChanges(changes) {
136
- if (!this.viewer) {
137
- return;
138
- }
139
- if (changes['scene'] && changes['scene'].currentValue) {
140
- this.viewer.load(changes['scene'].currentValue).catch(() => { });
141
- }
142
- if (changes['encoder'] && changes['encoder'].currentValue) {
143
- this.viewer.setEncoder(changes['encoder'].currentValue).catch(() => { });
144
- }
145
- if (changes['parameters'] && changes['parameters'].currentValue) {
146
- this.viewer.setParameters(changes['parameters'].currentValue).catch(() => { });
147
- }
148
- if (changes['tags'] && changes['tags'].currentValue) {
149
- this.viewer.setTags(changes['tags'].currentValue);
150
- }
151
- if (changes['view'] && changes['view'].currentValue) {
152
- this.viewer.setView(changes['view'].currentValue).catch(() => { });
153
- }
154
- if (changes['vrcube'] && changes['vrcube'].currentValue) {
155
- this.viewer.setVrcube(changes['vrcube'].currentValue);
156
- }
157
- if (changes['vrobject'] && changes['vrobject'].currentValue) {
158
- this.viewer.setVrobject(changes['vrobject'].currentValue);
159
- }
160
- }
161
- onHotspotsChange(hotspots) {
162
- this.hotspots = hotspots;
163
- if (this.hotspotsFilter !== undefined) {
164
- this.hotspots = this.hotspotsFilter(this.hotspots);
165
- }
166
- }
167
- snapshot(type, quality) {
168
- return this.viewer?.snapshot(type, quality);
169
- }
170
- onResize() {
171
- this.resolution = Viewport.getStandardResolution(window.innerWidth, window.innerHeight);
172
- this.fitPosition = Viewport.fit(this.resolution, window.innerWidth, window.innerHeight, 'cover');
173
- this.scaleX = this.fitPosition.width / this.resolution.width;
174
- this.scaleY = this.fitPosition.height / this.resolution.height;
175
- }
176
- hotspotStyle(hotspot) {
177
- if (this.view?.mode === 'vrcube') {
178
- return {
179
- position: 'absolute',
180
- top: hotspot.position2D.y + 'px',
181
- left: hotspot.position2D.x + 'px'
182
- };
183
- }
184
- else {
185
- return {
186
- position: 'absolute',
187
- top: (hotspot.position2D.y * this.scaleY + this.fitPosition.top) + 'px',
188
- left: (hotspot.position2D.x * this.scaleX + this.fitPosition.left) + 'px'
189
- };
190
- }
191
- }
192
- }
193
- NgViewerComponentfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: NgViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
194
- NgViewerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: NgViewerComponent, selector: "NgViewer", inputs: { server: "server", api: "api", fit: "fit", scene: "scene", encoder: "encoder", parameters: "parameters", view: "view", vrcube: "vrcube", vrobject: "vrobject", tags: "tags", hotspotTemplateRef: "hotspotTemplateRef", hotspotsFilter: "hotspotsFilter" }, outputs: { onLoadStart: "onLoadStart", onLoadProgress: "onLoadProgress", onLoadEnd: "onLoadEnd", onLoadError: "onLoadError", onInteraction: "onInteraction", onVrcubeInteraction: "onVrcubeInteraction", onVrobjectInteraction: "onVrobjectInteraction" }, host: { listeners: { "window:resize": "onResize($event)" } }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div #container></div>\n\n<div class=\"position-absolute w-100 h-100\" style=\"pointer-events: none;\" *ngIf=\"hotspots.length\">\n <div [ngStyle]=\"hotspotStyle(hotspot)\" *ngFor=\"let hotspot of hotspots\">\n <ng-container *ngTemplateOutlet=\"hotspotTemplateRef; context:{hotspot: hotspot}\"></ng-container>\n </div>\n</div>", styles: [":host{display:flex;flex:1 0 auto}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
195
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: NgViewerComponent, decorators: [{
196
- type: Component,
197
- args: [{ selector: 'NgViewer', template: "<div #container></div>\n\n<div class=\"position-absolute w-100 h-100\" style=\"pointer-events: none;\" *ngIf=\"hotspots.length\">\n <div [ngStyle]=\"hotspotStyle(hotspot)\" *ngFor=\"let hotspot of hotspots\">\n <ng-container *ngTemplateOutlet=\"hotspotTemplateRef; context:{hotspot: hotspot}\"></ng-container>\n </div>\n</div>", styles: [":host{display:flex;flex:1 0 auto}\n"] }]
198
- }], propDecorators: { server: [{
199
- type: Input
200
- }], api: [{
201
- type: Input
202
- }], fit: [{
203
- type: Input
204
- }], scene: [{
205
- type: Input
206
- }], encoder: [{
207
- type: Input
208
- }], parameters: [{
209
- type: Input
210
- }], view: [{
211
- type: Input
212
- }], vrcube: [{
213
- type: Input
214
- }], vrobject: [{
215
- type: Input
216
- }], tags: [{
217
- type: Input
218
- }], hotspotTemplateRef: [{
219
- type: Input
220
- }], hotspotsFilter: [{
221
- type: Input
222
- }], onLoadStart: [{
223
- type: Output
224
- }], onLoadProgress: [{
225
- type: Output
226
- }], onLoadEnd: [{
227
- type: Output
228
- }], onLoadError: [{
229
- type: Output
230
- }], onInteraction: [{
231
- type: Output
232
- }], onVrcubeInteraction: [{
233
- type: Output
234
- }], onVrobjectInteraction: [{
235
- type: Output
236
- }], container: [{
237
- type: ViewChild,
238
- args: ['container']
239
- }], onResize: [{
240
- type: HostListener,
241
- args: ['window:resize', ['$event']]
78
+ class NgViewerComponent {
79
+ constructor() {
80
+ this.hotspots = [];
81
+ this.hotspotTemplateRef = null;
82
+ this.onLoadStart = new EventEmitter();
83
+ this.onLoadProgress = new EventEmitter();
84
+ this.onLoadEnd = new EventEmitter();
85
+ this.onLoadError = new EventEmitter();
86
+ this.onInteraction = new EventEmitter();
87
+ this.onVrcubeInteraction = new EventEmitter();
88
+ this.onVrobjectInteraction = new EventEmitter();
89
+ this.fitPosition = { width: 1, height: 1, top: 1, left: 1 };
90
+ this.scaleX = 1;
91
+ this.scaleY = 1;
92
+ }
93
+ ngAfterViewInit() {
94
+ this.viewer = new Viewer(this.container.nativeElement, {
95
+ server: this.server,
96
+ api: this.api || 'v1',
97
+ fit: this.fit || 'cover',
98
+ events: {
99
+ onLoadStart: (...args) => { this.onLoadStart.emit(...args); },
100
+ onLoadProgress: (...args) => { this.onLoadProgress.emit(...args); },
101
+ onLoadEnd: (...args) => { this.onLoadEnd.emit(...args); },
102
+ onLoadError: (...args) => { this.onLoadError.emit(...args); },
103
+ onInteraction: (...args) => { this.onInteraction.emit(...args); },
104
+ onVrcubeInteraction: (...args) => { this.onVrcubeInteraction.emit(...args); },
105
+ onVrobjectInteraction: (...args) => { this.onVrobjectInteraction.emit(...args); },
106
+ onHotspotsChange: this.onHotspotsChange.bind(this)
107
+ },
108
+ });
109
+ if (this['scene']) {
110
+ this.viewer.load(this.scene).catch(() => { });
111
+ }
112
+ if (this['encoder']) {
113
+ this.viewer.setEncoder(this.encoder).catch(() => { });
114
+ }
115
+ if (this.parameters) {
116
+ this.viewer.setParameters(this.parameters).catch(() => { });
117
+ }
118
+ if (this.view) {
119
+ this.viewer.setView(this.view).catch(() => { });
120
+ }
121
+ if (this.vrcube) {
122
+ this.viewer.setVrcube(this.vrcube);
123
+ }
124
+ if (this.vrobject) {
125
+ this.viewer.setVrobject(this.vrobject);
126
+ }
127
+ if (this.tags) {
128
+ this.viewer.setTags(this.tags);
129
+ }
130
+ this.onResize();
131
+ }
132
+ ngOnDestroy() {
133
+ this.viewer?.destroy();
134
+ }
135
+ ngOnChanges(changes) {
136
+ if (!this.viewer) {
137
+ return;
138
+ }
139
+ if (changes['scene'] && changes['scene'].currentValue) {
140
+ this.viewer.load(changes['scene'].currentValue).catch(() => { });
141
+ }
142
+ if (changes['encoder'] && changes['encoder'].currentValue) {
143
+ this.viewer.setEncoder(changes['encoder'].currentValue).catch(() => { });
144
+ }
145
+ if (changes['parameters'] && changes['parameters'].currentValue) {
146
+ this.viewer.setParameters(changes['parameters'].currentValue).catch(() => { });
147
+ }
148
+ if (changes['tags'] && changes['tags'].currentValue) {
149
+ this.viewer.setTags(changes['tags'].currentValue);
150
+ }
151
+ if (changes['view'] && changes['view'].currentValue) {
152
+ this.viewer.setView(changes['view'].currentValue).catch(() => { });
153
+ }
154
+ if (changes['vrcube'] && changes['vrcube'].currentValue) {
155
+ this.viewer.setVrcube(changes['vrcube'].currentValue);
156
+ }
157
+ if (changes['vrobject'] && changes['vrobject'].currentValue) {
158
+ this.viewer.setVrobject(changes['vrobject'].currentValue);
159
+ }
160
+ }
161
+ onHotspotsChange(hotspots) {
162
+ this.hotspots = hotspots;
163
+ if (this.hotspotsFilter !== undefined) {
164
+ this.hotspots = this.hotspotsFilter(this.hotspots);
165
+ }
166
+ }
167
+ snapshot(type, quality) {
168
+ return this.viewer?.snapshot(type, quality);
169
+ }
170
+ onResize() {
171
+ this.resolution = Viewport.getStandardResolution(window.innerWidth, window.innerHeight);
172
+ this.fitPosition = Viewport.fit(this.resolution, window.innerWidth, window.innerHeight, 'cover');
173
+ this.scaleX = this.fitPosition.width / this.resolution.width;
174
+ this.scaleY = this.fitPosition.height / this.resolution.height;
175
+ }
176
+ hotspotStyle(hotspot) {
177
+ if (this.view?.mode === 'vrcube') {
178
+ return {
179
+ position: 'absolute',
180
+ top: hotspot.position2D.y + 'px',
181
+ left: hotspot.position2D.x + 'px'
182
+ };
183
+ }
184
+ else {
185
+ return {
186
+ position: 'absolute',
187
+ top: (hotspot.position2D.y * this.scaleY + this.fitPosition.top) + 'px',
188
+ left: (hotspot.position2D.x * this.scaleX + this.fitPosition.left) + 'px'
189
+ };
190
+ }
191
+ }
192
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.5", ngImport: i0, type: NgViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
193
+ static { thiscmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.5", type: NgViewerComponent, selector: "NgViewer", inputs: { server: "server", api: "api", fit: "fit", scene: "scene", encoder: "encoder", parameters: "parameters", view: "view", vrcube: "vrcube", vrobject: "vrobject", tags: "tags", hotspotTemplateRef: "hotspotTemplateRef", hotspotsFilter: "hotspotsFilter" }, outputs: { onLoadStart: "onLoadStart", onLoadProgress: "onLoadProgress", onLoadEnd: "onLoadEnd", onLoadError: "onLoadError", onInteraction: "onInteraction", onVrcubeInteraction: "onVrcubeInteraction", onVrobjectInteraction: "onVrobjectInteraction" }, host: { listeners: { "window:resize": "onResize($event)" } }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div #container></div>\n\n<div class=\"position-absolute w-100 h-100\" style=\"pointer-events: none;\" *ngIf=\"hotspots.length\">\n <div [ngStyle]=\"hotspotStyle(hotspot)\" *ngFor=\"let hotspot of hotspots\">\n <ng-container *ngTemplateOutlet=\"hotspotTemplateRef; context:{hotspot: hotspot}\"></ng-container>\n </div>\n</div>", styles: [":host{display:flex;flex:1 0 auto}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] }); }
194
+ }
195
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.5", ngImport: i0, type: NgViewerComponent, decorators: [{
196
+ type: Component,
197
+ args: [{ selector: 'NgViewer', template: "<div #container></div>\n\n<div class=\"position-absolute w-100 h-100\" style=\"pointer-events: none;\" *ngIf=\"hotspots.length\">\n <div [ngStyle]=\"hotspotStyle(hotspot)\" *ngFor=\"let hotspot of hotspots\">\n <ng-container *ngTemplateOutlet=\"hotspotTemplateRef; context:{hotspot: hotspot}\"></ng-container>\n </div>\n</div>", styles: [":host{display:flex;flex:1 0 auto}\n"] }]
198
+ }], propDecorators: { server: [{
199
+ type: Input
200
+ }], api: [{
201
+ type: Input
202
+ }], fit: [{
203
+ type: Input
204
+ }], scene: [{
205
+ type: Input
206
+ }], encoder: [{
207
+ type: Input
208
+ }], parameters: [{
209
+ type: Input
210
+ }], view: [{
211
+ type: Input
212
+ }], vrcube: [{
213
+ type: Input
214
+ }], vrobject: [{
215
+ type: Input
216
+ }], tags: [{
217
+ type: Input
218
+ }], hotspotTemplateRef: [{
219
+ type: Input
220
+ }], hotspotsFilter: [{
221
+ type: Input
222
+ }], onLoadStart: [{
223
+ type: Output
224
+ }], onLoadProgress: [{
225
+ type: Output
226
+ }], onLoadEnd: [{
227
+ type: Output
228
+ }], onLoadError: [{
229
+ type: Output
230
+ }], onInteraction: [{
231
+ type: Output
232
+ }], onVrcubeInteraction: [{
233
+ type: Output
234
+ }], onVrobjectInteraction: [{
235
+ type: Output
236
+ }], container: [{
237
+ type: ViewChild,
238
+ args: ['container']
239
+ }], onResize: [{
240
+ type: HostListener,
241
+ args: ['window:resize', ['$event']]
242
242
  }] } });
243
243
 
244
- class NgViewerModule {
245
- }
246
- NgViewerModulefac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: NgViewerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
247
- NgViewerModulemod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: NgViewerModule, declarations: [NgViewerComponent], imports: [CommonModule], exports: [NgViewerComponent] });
248
- NgViewerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: NgViewerModule, imports: [CommonModule] });
249
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: NgViewerModule, decorators: [{
250
- type: NgModule,
251
- args: [{
252
- declarations: [
253
- NgViewerComponent
254
- ],
255
- imports: [
256
- CommonModule
257
- ],
258
- exports: [
259
- NgViewerComponent
260
- ]
261
- }]
244
+ class NgViewerModule {
245
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.5", ngImport: i0, type: NgViewerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
246
+ static { thismod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.5", ngImport: i0, type: NgViewerModule, declarations: [NgViewerComponent], imports: [CommonModule], exports: [NgViewerComponent] }); }
247
+ static { thisinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.5", ngImport: i0, type: NgViewerModule, imports: [CommonModule] }); }
248
+ }
249
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.5", ngImport: i0, type: NgViewerModule, decorators: [{
250
+ type: NgModule,
251
+ args: [{
252
+ declarations: [
253
+ NgViewerComponent
254
+ ],
255
+ imports: [
256
+ CommonModule
257
+ ],
258
+ exports: [
259
+ NgViewerComponent
260
+ ]
261
+ }]
262
262
  }] });
263
263
 
264
- /*
265
- * Public API Surface of ng-viewer
264
+ /*
265
+ * Public API Surface of ng-viewer
266
266
  */
267
267
 
268
- /**
269
- * Generated bundle index. Do not edit.
268
+ /**
269
+ * Generated bundle index. Do not edit.
270
270
  */
271
271
 
272
272
  export { NgViewerComponent, NgViewerModule };
@@ -1 +1 @@
1
- {"version":3,"file":"lumiscaphe-ng-viewer.mjs","sources":["../../../projects/ng-viewer/src/lib/viewport.ts","../../../projects/ng-viewer/src/lib/ng-viewer.component.ts","../../../projects/ng-viewer/src/lib/ng-viewer.component.html","../../../projects/ng-viewer/src/lib/ng-viewer.module.ts","../../../projects/ng-viewer/src/public-api.ts","../../../projects/ng-viewer/src/lumiscaphe-ng-viewer.ts"],"sourcesContent":["export class Viewport {\n public static fit(resolution: any, viewportWidth: any, viewportHeight: any, fit: any): { width: number, height: number, top: number, left: number } {\n const aspectRatio = resolution.width / resolution.height;\n const viewportRatio = viewportWidth / viewportHeight;\n\n let width = 0;\n let height = 0;\n\n switch (fit) {\n case 'contain':\n width = viewportRatio < aspectRatio ? viewportWidth : viewportHeight * aspectRatio;\n height = viewportRatio < aspectRatio ? viewportWidth / aspectRatio : viewportHeight;\n break;\n case 'cover':\n default:\n width = viewportRatio < aspectRatio ? viewportHeight * aspectRatio : viewportWidth;\n height = viewportRatio < aspectRatio ? viewportHeight : viewportWidth / aspectRatio;\n break;\n case 'fill':\n width = viewportWidth;\n height = viewportHeight;\n break;\n }\n\n return {\n width: Math.round(width),\n height: Math.round(height),\n top: Math.round((viewportHeight - height) / 2),\n left: Math.round((viewportWidth - width) / 2),\n };\n }\n\n static getStandardAspectRatio(width: number, height: number): number {\n if (width === 0 || height === 0) {\n return 0;\n }\n\n const aspectRatio = width / height;\n\n if (width < height) {\n const distanceTo34 = Math.abs(3 / 4 - aspectRatio);\n const distanceTo916 = Math.abs(9 / 16 - aspectRatio);\n return distanceTo34 < distanceTo916 ? 3 / 4 : 9 / 16;\n }\n\n const distanceTo43 = Math.abs(4 / 3 - aspectRatio);\n const distanceTo169 = Math.abs(16 / 9 - aspectRatio);\n\n return distanceTo43 < distanceTo169 ? 4 / 3 : 16 / 9;\n }\n\n static getStandardQuality(height: number): number {\n if (height <= 240) {\n return 240;\n }\n\n if (height <= 360) {\n return 360;\n }\n\n if (height <= 480) {\n return 480;\n }\n\n if (height <= 720) {\n return 720;\n }\n\n return 1080;\n }\n\n public static getStandardResolution(width: number, height: number): { width: number, height: number } {\n if (width === 0 || height === 0) {\n return { width: 0, height: 0 };\n }\n\n const aspectRatio = Viewport.getStandardAspectRatio(width, height);\n\n if (width < height) {\n const quality = Viewport.getStandardQuality(height * aspectRatio);\n return { width: Math.round(quality), height: Math.round(quality / aspectRatio) };\n }\n\n const quality = Viewport.getStandardQuality(width / aspectRatio);\n return { width: Math.round(quality * aspectRatio), height: Math.round(quality) };\n }\n}\n\nexport default Viewport;\n","import { AfterViewInit, Component, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, SimpleChanges, ViewChild, Output, TemplateRef, HostListener } from '@angular/core';\n\nimport { Encoder, Hotspot, Parameters, Scene, View, Viewer, WidgetVRCube, WidgetVRObject } from '@lumiscaphe/viewer';\nimport Viewport from './viewport';\n\n@Component({\n selector: 'NgViewer',\n templateUrl: './ng-viewer.component.html',\n styleUrls: ['./ng-viewer.component.scss']\n})\n\nexport class NgViewerComponent implements AfterViewInit, OnChanges, OnDestroy {\n\n public viewer: Viewer | undefined;\n\n public hotspots: Hotspot[] = [];\n\n @Input() server: string | undefined;\n @Input() api: string | undefined;\n @Input() fit: 'contain' | 'cover' | 'fill' | undefined;\n @Input() scene: Scene | undefined;\n @Input() encoder: Encoder | undefined;\n @Input() parameters: Parameters | undefined;\n @Input() view: View | undefined;\n @Input() vrcube: Partial<WidgetVRCube> | undefined;\n @Input() vrobject: Partial<WidgetVRObject> | undefined;\n @Input() tags: string[] | undefined;\n @Input() hotspotTemplateRef: TemplateRef<any> | null = null;\n @Input() hotspotsFilter: ((hotspots: Hotspot[]) => Hotspot[]) | undefined;\n\n @Output() onLoadStart = new EventEmitter();\n @Output() onLoadProgress = new EventEmitter();\n @Output() onLoadEnd = new EventEmitter();\n @Output() onLoadError = new EventEmitter();\n @Output() onInteraction = new EventEmitter();\n @Output() onVrcubeInteraction = new EventEmitter();\n @Output() onVrobjectInteraction = new EventEmitter();\n\n @ViewChild('container') container!: ElementRef;\n\n ngAfterViewInit() {\n this.viewer = new Viewer(this.container.nativeElement, {\n server: this.server,\n api: this.api || 'v1',\n fit: this.fit || 'cover',\n events: {\n onLoadStart: (...args: any[]) => { this.onLoadStart.emit(...args); },\n onLoadProgress: (...args: any[]) => { this.onLoadProgress.emit(...args); },\n onLoadEnd: (...args: any[]) => { this.onLoadEnd.emit(...args); },\n onLoadError: (...args: any[]) => { this.onLoadError.emit(...args); },\n onInteraction: (...args: any[]) => { this.onInteraction.emit(...args); },\n onVrcubeInteraction: (...args: any[]) => { this.onVrcubeInteraction.emit(...args); },\n onVrobjectInteraction: (...args: any[]) => { this.onVrobjectInteraction.emit(...args); },\n onHotspotsChange: this.onHotspotsChange.bind(this)\n },\n });\n\n if (this['scene']) {\n this.viewer.load(this.scene).catch(() => { });\n }\n\n if (this['encoder']) {\n this.viewer.setEncoder(this.encoder).catch(() => { });\n }\n\n if (this.parameters) {\n this.viewer.setParameters(this.parameters).catch(() => { });\n }\n\n if (this.view) {\n this.viewer.setView(this.view).catch(() => { });\n }\n\n if (this.vrcube) {\n this.viewer.setVrcube(this.vrcube);\n }\n\n if (this.vrobject) {\n this.viewer.setVrobject(this.vrobject);\n }\n\n if (this.tags) {\n this.viewer.setTags(this.tags);\n }\n\n this.onResize();\n }\n\n ngOnDestroy(): void {\n this.viewer?.destroy();\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (!this.viewer) {\n return;\n }\n\n if (changes['scene'] && changes['scene'].currentValue) {\n this.viewer.load(changes['scene'].currentValue).catch(() => { });\n }\n\n if (changes['encoder'] && changes['encoder'].currentValue) {\n this.viewer.setEncoder(changes['encoder'].currentValue).catch(() => { });\n }\n\n if (changes['parameters'] && changes['parameters'].currentValue) {\n this.viewer.setParameters(changes['parameters'].currentValue).catch(() => { });\n }\n\n if (changes['tags'] && changes['tags'].currentValue) {\n this.viewer.setTags(changes['tags'].currentValue);\n }\n\n if (changes['view'] && changes['view'].currentValue) {\n this.viewer.setView(changes['view'].currentValue).catch(() => { });\n }\n\n if (changes['vrcube'] && changes['vrcube'].currentValue) {\n this.viewer.setVrcube(changes['vrcube'].currentValue);\n }\n\n if (changes['vrobject'] && changes['vrobject'].currentValue) {\n this.viewer.setVrobject(changes['vrobject'].currentValue);\n }\n }\n\n onHotspotsChange(hotspots: Hotspot[]): void {\n this.hotspots = hotspots;\n\n if (this.hotspotsFilter !== undefined) {\n this.hotspots = this.hotspotsFilter(this.hotspots);\n }\n }\n\n snapshot(type: string, quality: number): string | undefined {\n return this.viewer?.snapshot(type, quality);\n }\n\n public fitPosition: { width: number, height: number, top: number, left: number } = { width: 1, height: 1, top: 1, left: 1 };\n public resolution: { width: number, height: number } | undefined;\n public scaleX: number = 1;\n public scaleY: number = 1;\n\n @HostListener('window:resize', ['$event'])\n public onResize(): void {\n this.resolution = Viewport.getStandardResolution(window.innerWidth, window.innerHeight);\n this.fitPosition = Viewport.fit(this.resolution, window.innerWidth, window.innerHeight, 'cover');\n this.scaleX = this.fitPosition.width / this.resolution.width;\n this.scaleY = this.fitPosition.height / this.resolution.height;\n }\n\n public hotspotStyle(hotspot: Hotspot): { left: string, top: string, position: string } {\n if (this.view?.mode === 'vrcube') {\n return {\n position: 'absolute',\n top: hotspot.position2D.y + 'px',\n left: hotspot.position2D.x + 'px'\n };\n } else {\n return {\n position: 'absolute',\n top: (hotspot.position2D.y * this.scaleY + this.fitPosition.top) + 'px',\n left: (hotspot.position2D.x * this.scaleX + this.fitPosition.left) + 'px'\n };\n }\n }\n}\n","<div #container></div>\n\n<div class=\"position-absolute w-100 h-100\" style=\"pointer-events: none;\" *ngIf=\"hotspots.length\">\n <div [ngStyle]=\"hotspotStyle(hotspot)\" *ngFor=\"let hotspot of hotspots\">\n <ng-container *ngTemplateOutlet=\"hotspotTemplateRef; context:{hotspot: hotspot}\"></ng-container>\n </div>\n</div>","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { NgViewerComponent } from './ng-viewer.component';\n\n@NgModule({\n declarations: [\n NgViewerComponent\n ],\n imports: [\n CommonModule\n ],\n exports: [\n NgViewerComponent\n ]\n})\n\nexport class NgViewerModule { }\n","/*\n * Public API Surface of ng-viewer\n */\n\nexport * from './lib/ng-viewer.component';\nexport * from './lib/ng-viewer.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAAa,QAAQ,CAAA;IACZ,OAAO,GAAG,CAAC,UAAe,EAAE,aAAkB,EAAE,cAAmB,EAAE,GAAQ,EAAA;QAClF,MAAM,WAAW,GAAG,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC;AACzD,QAAA,MAAM,aAAa,GAAG,aAAa,GAAG,cAAc,CAAC;QAErD,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,IAAI,MAAM,GAAG,CAAC,CAAC;AAEf,QAAA,QAAQ,GAAG;AACT,YAAA,KAAK,SAAS;AACZ,gBAAA,KAAK,GAAG,aAAa,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,GAAG,WAAW,CAAC;AACnF,gBAAA,MAAM,GAAG,aAAa,GAAG,WAAW,GAAG,aAAa,GAAG,WAAW,GAAG,cAAc,CAAC;gBACpF,MAAM;AACR,YAAA,KAAK,OAAO,CAAC;AACb,YAAA;AACE,gBAAA,KAAK,GAAG,aAAa,GAAG,WAAW,GAAG,cAAc,GAAG,WAAW,GAAG,aAAa,CAAC;AACnF,gBAAA,MAAM,GAAG,aAAa,GAAG,WAAW,GAAG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AAA,CAAA,YAAY,aAGZ,iBAAiB,CAAA,EAAA,CAAA,CAAA;AAIR,cAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,YAPvB,YAAY,CAAA,EAAA,CAAA,CAAA;2FAOH,cAAc,EAAA,UAAA,EAAA,CAAA;kBAZ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,iBAAiB;AAClB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,iBAAiB;AAClB,qBAAA;AACF,iBAAA,CAAA;;;ACdD;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"lumiscaphe-ng-viewer.mjs","sources":["../../../projects/ng-viewer/src/lib/viewport.ts","../../../projects/ng-viewer/src/lib/ng-viewer.component.ts","../../../projects/ng-viewer/src/lib/ng-viewer.component.html","../../../projects/ng-viewer/src/lib/ng-viewer.module.ts","../../../projects/ng-viewer/src/public-api.ts","../../../projects/ng-viewer/src/lumiscaphe-ng-viewer.ts"],"sourcesContent":["export class Viewport {\n public static fit(resolution: any, viewportWidth: any, viewportHeight: any, fit: any): { width: number, height: number, top: number, left: number } {\n const aspectRatio = resolution.width / resolution.height;\n const viewportRatio = viewportWidth / viewportHeight;\n\n let width = 0;\n let height = 0;\n\n switch (fit) {\n case 'contain':\n width = viewportRatio < aspectRatio ? viewportWidth : viewportHeight * aspectRatio;\n height = viewportRatio < aspectRatio ? viewportWidth / aspectRatio : viewportHeight;\n break;\n case 'cover':\n default:\n width = viewportRatio < aspectRatio ? viewportHeight * aspectRatio : viewportWidth;\n height = viewportRatio < aspectRatio ? viewportHeight : viewportWidth / aspectRatio;\n break;\n case 'fill':\n width = viewportWidth;\n height = viewportHeight;\n break;\n }\n\n return {\n width: Math.round(width),\n height: Math.round(height),\n top: Math.round((viewportHeight - height) / 2),\n left: Math.round((viewportWidth - width) / 2),\n };\n }\n\n static getStandardAspectRatio(width: number, height: number): number {\n if (width === 0 || height === 0) {\n return 0;\n }\n\n const aspectRatio = width / height;\n\n if (width < height) {\n const distanceTo34 = Math.abs(3 / 4 - aspectRatio);\n const distanceTo916 = Math.abs(9 / 16 - aspectRatio);\n return distanceTo34 < distanceTo916 ? 3 / 4 : 9 / 16;\n }\n\n const distanceTo43 = Math.abs(4 / 3 - aspectRatio);\n const distanceTo169 = Math.abs(16 / 9 - aspectRatio);\n\n return distanceTo43 < distanceTo169 ? 4 / 3 : 16 / 9;\n }\n\n static getStandardQuality(height: number): number {\n if (height <= 240) {\n return 240;\n }\n\n if (height <= 360) {\n return 360;\n }\n\n if (height <= 480) {\n return 480;\n }\n\n if (height <= 720) {\n return 720;\n }\n\n return 1080;\n }\n\n public static getStandardResolution(width: number, height: number): { width: number, height: number } {\n if (width === 0 || height === 0) {\n return { width: 0, height: 0 };\n }\n\n const aspectRatio = Viewport.getStandardAspectRatio(width, height);\n\n if (width < height) {\n const quality = Viewport.getStandardQuality(height * aspectRatio);\n return { width: Math.round(quality), height: Math.round(quality / aspectRatio) };\n }\n\n const quality = Viewport.getStandardQuality(width / aspectRatio);\n return { width: Math.round(quality * aspectRatio), height: Math.round(quality) };\n }\n}\n\nexport default Viewport;\n","import { AfterViewInit, Component, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, SimpleChanges, ViewChild, Output, TemplateRef, HostListener } from '@angular/core';\n\nimport { Encoder, Hotspot, Parameters, Scene, View, Viewer, WidgetVRCube, WidgetVRObject } from '@lumiscaphe/viewer';\nimport Viewport from './viewport';\n\n@Component({\n selector: 'NgViewer',\n templateUrl: './ng-viewer.component.html',\n styleUrls: ['./ng-viewer.component.scss']\n})\n\nexport class NgViewerComponent implements AfterViewInit, OnChanges, OnDestroy {\n\n public viewer: Viewer | undefined;\n\n public hotspots: Hotspot[] = [];\n\n @Input() server: string | undefined;\n @Input() api: string | undefined;\n @Input() fit: 'contain' | 'cover' | 'fill' | undefined;\n @Input() scene: Scene | undefined;\n @Input() encoder: Encoder | undefined;\n @Input() parameters: Parameters | undefined;\n @Input() view: View | undefined;\n @Input() vrcube: Partial<WidgetVRCube> | undefined;\n @Input() vrobject: Partial<WidgetVRObject> | undefined;\n @Input() tags: string[] | undefined;\n @Input() hotspotTemplateRef: TemplateRef<any> | null = null;\n @Input() hotspotsFilter: ((hotspots: Hotspot[]) => Hotspot[]) | undefined;\n\n @Output() onLoadStart = new EventEmitter();\n @Output() onLoadProgress = new EventEmitter();\n @Output() onLoadEnd = new EventEmitter();\n @Output() onLoadError = new EventEmitter();\n @Output() onInteraction = new EventEmitter();\n @Output() onVrcubeInteraction = new EventEmitter();\n @Output() onVrobjectInteraction = new EventEmitter();\n\n @ViewChild('container') container!: ElementRef;\n\n ngAfterViewInit() {\n this.viewer = new Viewer(this.container.nativeElement, {\n server: this.server,\n api: this.api || 'v1',\n fit: this.fit || 'cover',\n events: {\n onLoadStart: (...args: any[]) => { this.onLoadStart.emit(...args); },\n onLoadProgress: (...args: any[]) => { this.onLoadProgress.emit(...args); },\n onLoadEnd: (...args: any[]) => { this.onLoadEnd.emit(...args); },\n onLoadError: (...args: any[]) => { this.onLoadError.emit(...args); },\n onInteraction: (...args: any[]) => { this.onInteraction.emit(...args); },\n onVrcubeInteraction: (...args: any[]) => { this.onVrcubeInteraction.emit(...args); },\n onVrobjectInteraction: (...args: any[]) => { this.onVrobjectInteraction.emit(...args); },\n onHotspotsChange: this.onHotspotsChange.bind(this)\n },\n });\n\n if (this['scene']) {\n this.viewer.load(this.scene).catch(() => { });\n }\n\n if (this['encoder']) {\n this.viewer.setEncoder(this.encoder).catch(() => { });\n }\n\n if (this.parameters) {\n this.viewer.setParameters(this.parameters).catch(() => { });\n }\n\n if (this.view) {\n this.viewer.setView(this.view).catch(() => { });\n }\n\n if (this.vrcube) {\n this.viewer.setVrcube(this.vrcube);\n }\n\n if (this.vrobject) {\n this.viewer.setVrobject(this.vrobject);\n }\n\n if (this.tags) {\n this.viewer.setTags(this.tags);\n }\n\n this.onResize();\n }\n\n ngOnDestroy(): void {\n this.viewer?.destroy();\n }\n\n ngOnChanges(changes: SimpleChanges) {\n if (!this.viewer) {\n return;\n }\n\n if (changes['scene'] && changes['scene'].currentValue) {\n this.viewer.load(changes['scene'].currentValue).catch(() => { });\n }\n\n if (changes['encoder'] && changes['encoder'].currentValue) {\n this.viewer.setEncoder(changes['encoder'].currentValue).catch(() => { });\n }\n\n if (changes['parameters'] && changes['parameters'].currentValue) {\n this.viewer.setParameters(changes['parameters'].currentValue).catch(() => { });\n }\n\n if (changes['tags'] && changes['tags'].currentValue) {\n this.viewer.setTags(changes['tags'].currentValue);\n }\n\n if (changes['view'] && changes['view'].currentValue) {\n this.viewer.setView(changes['view'].currentValue).catch(() => { });\n }\n\n if (changes['vrcube'] && changes['vrcube'].currentValue) {\n this.viewer.setVrcube(changes['vrcube'].currentValue);\n }\n\n if (changes['vrobject'] && changes['vrobject'].currentValue) {\n this.viewer.setVrobject(changes['vrobject'].currentValue);\n }\n }\n\n onHotspotsChange(hotspots: Hotspot[]): void {\n this.hotspots = hotspots;\n\n if (this.hotspotsFilter !== undefined) {\n this.hotspots = this.hotspotsFilter(this.hotspots);\n }\n }\n\n snapshot(type: string, quality: number): string | undefined {\n return this.viewer?.snapshot(type, quality);\n }\n\n public fitPosition: { width: number, height: number, top: number, left: number } = { width: 1, height: 1, top: 1, left: 1 };\n public resolution: { width: number, height: number } | undefined;\n public scaleX: number = 1;\n public scaleY: number = 1;\n\n @HostListener('window:resize', ['$event'])\n public onResize(): void {\n this.resolution = Viewport.getStandardResolution(window.innerWidth, window.innerHeight);\n this.fitPosition = Viewport.fit(this.resolution, window.innerWidth, window.innerHeight, 'cover');\n this.scaleX = this.fitPosition.width / this.resolution.width;\n this.scaleY = this.fitPosition.height / this.resolution.height;\n }\n\n public hotspotStyle(hotspot: Hotspot): { left: string, top: string, position: string } {\n if (this.view?.mode === 'vrcube') {\n return {\n position: 'absolute',\n top: hotspot.position2D.y + 'px',\n left: hotspot.position2D.x + 'px'\n };\n } else {\n return {\n position: 'absolute',\n top: (hotspot.position2D.y * this.scaleY + this.fitPosition.top) + 'px',\n left: (hotspot.position2D.x * this.scaleX + this.fitPosition.left) + 'px'\n };\n }\n }\n}\n","<div #container></div>\n\n<div class=\"position-absolute w-100 h-100\" style=\"pointer-events: none;\" *ngIf=\"hotspots.length\">\n <div [ngStyle]=\"hotspotStyle(hotspot)\" *ngFor=\"let hotspot of hotspots\">\n <ng-container *ngTemplateOutlet=\"hotspotTemplateRef; context:{hotspot: hotspot}\"></ng-container>\n </div>\n</div>","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { NgViewerComponent } from './ng-viewer.component';\n\n@NgModule({\n declarations: [\n NgViewerComponent\n ],\n imports: [\n CommonModule\n ],\n exports: [\n NgViewerComponent\n ]\n})\n\nexport class NgViewerModule { }\n","/*\n * Public API Surface of ng-viewer\n */\n\nexport * from './lib/ng-viewer.component';\nexport * from './lib/ng-viewer.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAAa,QAAQ,CAAA;IACZ,OAAO,GAAG,CAAC,UAAe,EAAE,aAAkB,EAAE,cAAmB,EAAE,GAAQ,EAAA;QAClF,MAAM,WAAW,GAAG,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC;AACzD,QAAA,MAAM,aAAa,GAAG,aAAa,GAAG,cAAc,CAAC;QAErD,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,IAAI,MAAM,GAAG,CAAC,CAAC;AAEf,QAAA,QAAQ,GAAG;AACT,YAAA,KAAK,SAAS;AACZ,gBAAA,KAAK,GAAG,aAAa,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,GAAG,WAAW,CAAC;AACnF,gBAAA,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