@tetacom/ng-components 1.1.15 → 1.1.16
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/component/three/three-chart/block-3d/block-3d.component.d.ts +1 -1
- package/component/three/three-chart/line-3d/line-3d.component.d.ts +2 -2
- package/component/three/three-chart/model/public-api.d.ts +1 -1
- package/esm2022/component/three/three-chart/axes-3d/axes-3d.component.mjs +3 -3
- package/esm2022/component/three/three-chart/block-3d/block-3d.component.mjs +14 -15
- package/esm2022/component/three/three-chart/line-3d/line-3d.component.mjs +7 -9
- package/esm2022/component/three/three-chart/model/block-3d-series.mjs +2 -0
- package/esm2022/component/three/three-chart/model/public-api.mjs +2 -2
- package/esm2022/component/three/three-chart/service/chart-3d.service.mjs +21 -12
- package/esm2022/component/three/three-chart/three-chart.component.mjs +3 -3
- package/fesm2022/tetacom-ng-components.mjs +43 -37
- package/fesm2022/tetacom-ng-components.mjs.map +1 -1
- package/package.json +1 -1
- package/assets/square.svg +0 -7
- package/esm2022/component/three/three-chart/model/lithotype-3d-series.mjs +0 -2
- /package/component/three/three-chart/model/{lithotype-3d-series.d.ts → block-3d-series.d.ts} +0 -0
|
@@ -12072,11 +12072,11 @@ class Chart3dService {
|
|
|
12072
12072
|
this.data = this.data$.asObservable();
|
|
12073
12073
|
this.minMax = this.minMax$.asObservable();
|
|
12074
12074
|
this.data
|
|
12075
|
-
.pipe(tap$1(
|
|
12075
|
+
.pipe(tap$1(_ => {
|
|
12076
12076
|
this.minMax$.next(this.getAxesMinMax(_));
|
|
12077
12077
|
}))
|
|
12078
12078
|
.subscribe();
|
|
12079
|
-
this.scales = this.minMax.pipe(map$1(
|
|
12079
|
+
this.scales = this.minMax.pipe(map$1(minMax => {
|
|
12080
12080
|
return this.getScales(minMax);
|
|
12081
12081
|
}), shareReplay(1));
|
|
12082
12082
|
}
|
|
@@ -12085,20 +12085,29 @@ class Chart3dService {
|
|
|
12085
12085
|
}
|
|
12086
12086
|
getAxesMinMax(data) {
|
|
12087
12087
|
const zArr = data.series
|
|
12088
|
-
.map(
|
|
12089
|
-
return _
|
|
12088
|
+
.map(_ => {
|
|
12089
|
+
return _?.data?.map(d => d?.z);
|
|
12090
12090
|
})
|
|
12091
|
-
.flat()
|
|
12091
|
+
.flat()
|
|
12092
|
+
.filter(_ => {
|
|
12093
|
+
return _ !== null && _ !== undefined;
|
|
12094
|
+
});
|
|
12092
12095
|
const xArr = data.series
|
|
12093
|
-
.map(
|
|
12094
|
-
return _
|
|
12096
|
+
.map(_ => {
|
|
12097
|
+
return _?.data?.map(d => d?.x);
|
|
12095
12098
|
})
|
|
12096
|
-
.flat()
|
|
12099
|
+
.flat()
|
|
12100
|
+
.filter(_ => {
|
|
12101
|
+
return _ !== null && _ !== undefined;
|
|
12102
|
+
});
|
|
12097
12103
|
const yArr = data.series
|
|
12098
|
-
.map(
|
|
12099
|
-
return _
|
|
12104
|
+
.map(_ => {
|
|
12105
|
+
return _?.data?.map(d => d?.y);
|
|
12100
12106
|
})
|
|
12101
|
-
.flat()
|
|
12107
|
+
.flat()
|
|
12108
|
+
.filter(_ => {
|
|
12109
|
+
return _ !== null && _ !== undefined;
|
|
12110
|
+
});
|
|
12102
12111
|
const ZMinMaxVal = [Math.min(...zArr), Math.max(...zArr)];
|
|
12103
12112
|
const XMinMaxVal = [Math.min(...xArr), Math.max(...xArr)];
|
|
12104
12113
|
const YMinMaxVal = [Math.min(...yArr), Math.max(...yArr)];
|
|
@@ -12272,11 +12281,11 @@ class Axes3dComponent {
|
|
|
12272
12281
|
this._alive = false;
|
|
12273
12282
|
}
|
|
12274
12283
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: Axes3dComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12275
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.1", type: Axes3dComponent, isStandalone: true, selector: "teta-axes-3d", inputs: { rotation: "rotation" }, ngImport: i0, template: "<ng-container *ngIf=\"{axes:axes|async}as data\">\n<ngts-text *ngFor=\"let tick of data.axes
|
|
12284
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.1", type: Axes3dComponent, isStandalone: true, selector: "teta-axes-3d", inputs: { rotation: "rotation" }, ngImport: i0, template: "<ng-container *ngIf=\"{axes:axes|async}as data\">\n<ngts-text *ngFor=\"let tick of data.axes?.y;let i=index\" [text]=\"tick.value+'-'\"\n [color]=\"'var(--color-text-90)'\"\n [rotation]=\"rotation\"\n [fontSize]=\"2.5\"\n [position]=\"[0,tick.position,50]\"\n [anchorX]=\"'right'\"\n [anchorY]=\"'middle'\"\n [textAlign]=\"'right'\"\n></ngts-text>\n<ngts-text *ngFor=\"let tick of data.axes?.z;let i=index\" [text]=\"tick.value\"\n [color]=\"'var(--color-text-90)'\"\n [rotation]=\"rotation\"\n [fontSize]=\"2.5\"\n [position]=\"[25,-50,tick.position]\"\n ></ngts-text>\n</ng-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "component", type: NgtsText, selector: "ngts-text[text]", inputs: ["textRef", "text", "characters", "font", "anchorX", "anchorY"], outputs: ["sync"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
12276
12285
|
}
|
|
12277
12286
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: Axes3dComponent, decorators: [{
|
|
12278
12287
|
type: Component,
|
|
12279
|
-
args: [{ selector: 'teta-axes-3d', standalone: true, imports: [CommonModule, NgtsText], schemas: [CUSTOM_ELEMENTS_SCHEMA], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"{axes:axes|async}as data\">\n<ngts-text *ngFor=\"let tick of data.axes
|
|
12288
|
+
args: [{ selector: 'teta-axes-3d', standalone: true, imports: [CommonModule, NgtsText], schemas: [CUSTOM_ELEMENTS_SCHEMA], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"{axes:axes|async}as data\">\n<ngts-text *ngFor=\"let tick of data.axes?.y;let i=index\" [text]=\"tick.value+'-'\"\n [color]=\"'var(--color-text-90)'\"\n [rotation]=\"rotation\"\n [fontSize]=\"2.5\"\n [position]=\"[0,tick.position,50]\"\n [anchorX]=\"'right'\"\n [anchorY]=\"'middle'\"\n [textAlign]=\"'right'\"\n></ngts-text>\n<ngts-text *ngFor=\"let tick of data.axes?.z;let i=index\" [text]=\"tick.value\"\n [color]=\"'var(--color-text-90)'\"\n [rotation]=\"rotation\"\n [fontSize]=\"2.5\"\n [position]=\"[25,-50,tick.position]\"\n ></ngts-text>\n</ng-container>\n" }]
|
|
12280
12289
|
}], ctorParameters: function () { return []; }, propDecorators: { rotation: [{
|
|
12281
12290
|
type: Input
|
|
12282
12291
|
}] } });
|
|
@@ -12293,22 +12302,21 @@ class Block3dComponent extends Base3dSeriesComponent {
|
|
|
12293
12302
|
this.svc = svc;
|
|
12294
12303
|
this.ngtStore = ngtStore;
|
|
12295
12304
|
this.blocks = this.svc.scales.pipe(takeWhile(() => this._alive), map$1(scales => {
|
|
12296
|
-
return this.series?.data
|
|
12297
|
-
return this.createSVGTexture(scales.y(_
|
|
12305
|
+
return this.series?.data?.map(_ => {
|
|
12306
|
+
return this.createSVGTexture(scales.y(_?.y), scales.y(_?.y1), _?.iconId);
|
|
12298
12307
|
});
|
|
12299
12308
|
}));
|
|
12300
12309
|
}
|
|
12301
|
-
// ngOnInit(): void {}
|
|
12302
12310
|
createSVGTexture(y, y1, iconId) {
|
|
12303
12311
|
const max = Math.max(y, y1);
|
|
12304
12312
|
const min = Math.min(y, y1);
|
|
12305
12313
|
const height = Math.abs(max - min);
|
|
12306
|
-
const icon = document.querySelector(`#${iconId}`);
|
|
12307
|
-
const svgString = `<svg width='100' height='100' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'>${icon
|
|
12314
|
+
const icon = iconId ? document.querySelector(`#${iconId}`) : null;
|
|
12315
|
+
const svgString = icon ? `<svg width='100' height='100' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'>${icon?.innerHTML}</svg>` : null;
|
|
12308
12316
|
const loader = new THREE.TextureLoader();
|
|
12309
12317
|
const texture = loader.load(`data:image/svg+xml;charset=utf-8,${encodeURIComponent(svgString)}`);
|
|
12310
|
-
const plane = this.createTexturedPlane(texture, 100, height);
|
|
12311
|
-
const plane1 = this.createTexturedPlane(texture, 25, height);
|
|
12318
|
+
const plane = this.createTexturedPlane(texture, 100, height, !!icon);
|
|
12319
|
+
const plane1 = this.createTexturedPlane(texture, 25, height, !!icon);
|
|
12312
12320
|
plane.rotation.set(0, Math.PI / 2, 0);
|
|
12313
12321
|
plane.position.set(0.17, min + height / 2, 0);
|
|
12314
12322
|
plane1.position.set(25 / 2, min + height / 2, -50 + 0.17);
|
|
@@ -12317,22 +12325,22 @@ class Block3dComponent extends Base3dSeriesComponent {
|
|
|
12317
12325
|
{ component: plane1, position: min + height / 2 },
|
|
12318
12326
|
];
|
|
12319
12327
|
}
|
|
12320
|
-
createTexturedPlane(texture, width, height) {
|
|
12328
|
+
createTexturedPlane(texture, width, height, visible) {
|
|
12321
12329
|
texture.wrapS = THREE.RepeatWrapping;
|
|
12322
12330
|
texture.wrapT = THREE.RepeatWrapping;
|
|
12323
|
-
texture.repeat.set(10, 9);
|
|
12324
|
-
const material = new THREE.MeshBasicMaterial({ map: texture });
|
|
12331
|
+
texture.repeat.set(10, height / 9);
|
|
12332
|
+
const material = new THREE.MeshBasicMaterial({ map: texture, visible });
|
|
12325
12333
|
const geometry = new THREE.PlaneGeometry(width, height, 1, 1);
|
|
12326
12334
|
const uvs = geometry.attributes['uv'].array;
|
|
12327
12335
|
const newUvs = new Float32Array(uvs);
|
|
12328
12336
|
newUvs[0] = 0;
|
|
12329
|
-
newUvs[1] =
|
|
12337
|
+
newUvs[1] = 1;
|
|
12330
12338
|
newUvs[2] = width / 100;
|
|
12331
|
-
newUvs[3] =
|
|
12339
|
+
newUvs[3] = 1;
|
|
12332
12340
|
newUvs[4] = 0;
|
|
12333
|
-
newUvs[5] =
|
|
12341
|
+
newUvs[5] = 0;
|
|
12334
12342
|
newUvs[6] = width / 100;
|
|
12335
|
-
newUvs[7] =
|
|
12343
|
+
newUvs[7] = 0;
|
|
12336
12344
|
geometry.attributes['uv'].needsUpdate = true;
|
|
12337
12345
|
geometry.setAttribute('uv', new THREE.BufferAttribute(newUvs, 2));
|
|
12338
12346
|
return new THREE.Mesh(geometry, material);
|
|
@@ -12359,26 +12367,24 @@ class Line3dComponent extends Base3dSeriesComponent {
|
|
|
12359
12367
|
super(svc, ngtStore);
|
|
12360
12368
|
this.svc = svc;
|
|
12361
12369
|
this.ngtStore = ngtStore;
|
|
12362
|
-
this.points = this.svc.scales.pipe(takeWhile(() => this._alive), map$1(
|
|
12370
|
+
this.points = this.svc.scales.pipe(takeWhile(() => this._alive), map$1(scales => {
|
|
12363
12371
|
return this.getPoints(scales);
|
|
12364
12372
|
}));
|
|
12365
12373
|
}
|
|
12366
12374
|
getPoints(scales) {
|
|
12367
|
-
return this.series
|
|
12368
|
-
.
|
|
12369
|
-
|
|
12370
|
-
})
|
|
12371
|
-
.flat();
|
|
12375
|
+
return this.series?.data?.map(_ => {
|
|
12376
|
+
return [scales.x(_?.x), scales.y(_?.y), scales.z(_?.z)];
|
|
12377
|
+
});
|
|
12372
12378
|
}
|
|
12373
12379
|
ngOnDestroy() {
|
|
12374
12380
|
this._alive = false;
|
|
12375
12381
|
}
|
|
12376
12382
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: Line3dComponent, deps: [{ token: Chart3dService }, { token: i2.NgtStore }], target: i0.ɵɵFactoryTarget.Component });
|
|
12377
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.1", type: Line3dComponent, isStandalone: true, selector: "teta-line-3d", usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"{points:points|async}as data\">\n <ngt-mesh>\n <ngts-line [color]=\"series.color\" [lineWidth]=\"2\" [points]=\"data.points\"></ngts-line>\n <ngt-line-basic-material></ngt-line-basic-material>\n </ngt-mesh>\n</ng-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "component", type: NgtsLine, selector: "ngts-line[points]", inputs: ["lineRef", "points", "segments"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
12383
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.1", type: Line3dComponent, isStandalone: true, selector: "teta-line-3d", usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"{points:points|async}as data\">\n <ngt-mesh *ngIf=\"data?.points?.length\">\n <ngts-line [color]=\"series.color\" [lineWidth]=\"2\" [points]=\"data.points\"></ngts-line>\n <ngt-line-basic-material></ngt-line-basic-material>\n </ngt-mesh>\n</ng-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "component", type: NgtsLine, selector: "ngts-line[points]", inputs: ["lineRef", "points", "segments"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
12378
12384
|
}
|
|
12379
12385
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: Line3dComponent, decorators: [{
|
|
12380
12386
|
type: Component,
|
|
12381
|
-
args: [{ selector: 'teta-line-3d', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, NgtsLine, NgtArgs], schemas: [CUSTOM_ELEMENTS_SCHEMA], template: "<ng-container *ngIf=\"{points:points|async}as data\">\n <ngt-mesh>\n <ngts-line [color]=\"series.color\" [lineWidth]=\"2\" [points]=\"data.points\"></ngts-line>\n <ngt-line-basic-material></ngt-line-basic-material>\n </ngt-mesh>\n</ng-container>\n" }]
|
|
12387
|
+
args: [{ selector: 'teta-line-3d', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, NgtsLine, NgtArgs], schemas: [CUSTOM_ELEMENTS_SCHEMA], template: "<ng-container *ngIf=\"{points:points|async}as data\">\n <ngt-mesh *ngIf=\"data?.points?.length\">\n <ngts-line [color]=\"series.color\" [lineWidth]=\"2\" [points]=\"data.points\"></ngts-line>\n <ngt-line-basic-material></ngt-line-basic-material>\n </ngt-mesh>\n</ng-container>\n" }]
|
|
12382
12388
|
}], ctorParameters: function () { return [{ type: Chart3dService }, { type: i2.NgtStore }]; } });
|
|
12383
12389
|
|
|
12384
12390
|
var Series3dType;
|
|
@@ -12483,11 +12489,11 @@ class ThreeChartComponent {
|
|
|
12483
12489
|
}
|
|
12484
12490
|
}
|
|
12485
12491
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: ThreeChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12486
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.1", type: ThreeChartComponent, isStandalone: true, selector: "teta-three-chart", inputs: { data: "data" }, providers: [NgtStore], usesOnChanges: true, ngImport: i0, template: "<div class=\"column_auto column justify-content-center align-center\" style=\"height: 100%;width: 100%;\">\n <ngt-canvas *ngIf=\"data?.series?.length;else noData\" [sceneGraph]=\"scene\"\n [camera]=\"camera\">\n </ngt-canvas>\n <ng-template #noData>\n <p>{{data
|
|
12492
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.1", type: ThreeChartComponent, isStandalone: true, selector: "teta-three-chart", inputs: { data: "data" }, providers: [NgtStore], usesOnChanges: true, ngImport: i0, template: "<div class=\"column_auto column justify-content-center align-center\" style=\"height: 100%;width: 100%;\">\n <ngt-canvas *ngIf=\"data?.series?.length;else noData\" [sceneGraph]=\"scene\"\n [camera]=\"camera\">\n </ngt-canvas>\n <ng-template #noData>\n <p>{{data?.noDataText||'no data'}}</p>\n </ng-template>\n</div>\n", styles: [":host{width:100%;height:100%}\n"], dependencies: [{ kind: "component", type: NgtCanvas, selector: "ngt-canvas", inputs: ["sceneGraph", "sceneGraphInputs", "compoundPrefixes", "linear", "legacy", "flat", "orthographic", "frameloop", "dpr", "raycaster", "shadows", "camera", "gl", "eventSource", "eventPrefix", "lookAt", "performance"], outputs: ["created", "pointerMissed"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
12487
12493
|
}
|
|
12488
12494
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: ThreeChartComponent, decorators: [{
|
|
12489
12495
|
type: Component,
|
|
12490
|
-
args: [{ selector: 'teta-three-chart', standalone: true, schemas: [CUSTOM_ELEMENTS_SCHEMA], changeDetection: ChangeDetectionStrategy.OnPush, providers: [NgtStore], imports: [NgtCanvas, SceneComponent, CommonModule], template: "<div class=\"column_auto column justify-content-center align-center\" style=\"height: 100%;width: 100%;\">\n <ngt-canvas *ngIf=\"data?.series?.length;else noData\" [sceneGraph]=\"scene\"\n [camera]=\"camera\">\n </ngt-canvas>\n <ng-template #noData>\n <p>{{data
|
|
12496
|
+
args: [{ selector: 'teta-three-chart', standalone: true, schemas: [CUSTOM_ELEMENTS_SCHEMA], changeDetection: ChangeDetectionStrategy.OnPush, providers: [NgtStore], imports: [NgtCanvas, SceneComponent, CommonModule], template: "<div class=\"column_auto column justify-content-center align-center\" style=\"height: 100%;width: 100%;\">\n <ngt-canvas *ngIf=\"data?.series?.length;else noData\" [sceneGraph]=\"scene\"\n [camera]=\"camera\">\n </ngt-canvas>\n <ng-template #noData>\n <p>{{data?.noDataText||'no data'}}</p>\n </ng-template>\n</div>\n", styles: [":host{width:100%;height:100%}\n"] }]
|
|
12491
12497
|
}], propDecorators: { data: [{
|
|
12492
12498
|
type: Input
|
|
12493
12499
|
}] } });
|