@tetacom/svg-charts 1.7.19 → 1.7.20
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/chart/chart-container/series-controls/series-controls.component.d.ts +1 -0
- package/chart/directives/zoomable.directive.d.ts +2 -2
- package/chart/model/enum/series-type.d.ts +2 -1
- package/chart/model/series.d.ts +1 -0
- package/fesm2022/tetacom-svg-charts.mjs +11 -7
- package/fesm2022/tetacom-svg-charts.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -7,6 +7,7 @@ export declare class SeriesControlsComponent {
|
|
|
7
7
|
private chartService;
|
|
8
8
|
protected readonly Align: typeof Align;
|
|
9
9
|
series: import("@angular/core").InputSignal<Series<BasePoint>[]>;
|
|
10
|
+
availableSeries: import("@angular/core").Signal<Series<BasePoint>[]>;
|
|
10
11
|
enabledSeries: import("@angular/core").Signal<Series<BasePoint>[]>;
|
|
11
12
|
disabledSeries: import("@angular/core").Signal<Series<BasePoint>[]>;
|
|
12
13
|
strokeWidth: {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AfterViewInit, ElementRef, NgZone, OnDestroy } from '@angular/core';
|
|
1
|
+
import { AfterViewInit, ElementRef, NgZone, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { ZoomService } from '../service/zoom.service';
|
|
3
3
|
import { IChartConfig } from '../model/i-chart-config';
|
|
4
4
|
import { Axis } from '../core/axis/axis';
|
|
5
5
|
import { D3ZoomEvent } from 'd3';
|
|
6
6
|
import { ScaleService } from '../service/scale.service';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
|
-
export declare class ZoomableDirective implements OnDestroy, AfterViewInit {
|
|
8
|
+
export declare class ZoomableDirective implements OnDestroy, AfterViewInit, OnInit {
|
|
9
9
|
private elementRef;
|
|
10
10
|
private zoomService;
|
|
11
11
|
private scaleService;
|
package/chart/model/series.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { maxIndex } from 'd3-array';
|
|
|
7
7
|
import { toSignal } from '@angular/core/rxjs-interop';
|
|
8
8
|
import * as i3 from '@angular/platform-browser';
|
|
9
9
|
import { AsyncPipe, NgTemplateOutlet, KeyValuePipe, NgStyle } from '@angular/common';
|
|
10
|
-
import { Align as Align$1, TetaSize, ButtonComponent, DropdownComponent, DropdownContentDirective, DropdownHeadDirective, IconComponent, AccordionComponent, AccordionHeadComponent, AccordionItemComponent, AccordionContentDirective, ColorInputComponent, SelectComponent, SelectOptionDirective, SelectValueDirective, ScrollableComponent, InputComponent
|
|
10
|
+
import { Align as Align$1, TetaSize, ButtonComponent, DropdownComponent, DropdownContentDirective, DropdownHeadDirective, IconComponent, AccordionComponent, AccordionHeadComponent, AccordionItemComponent, AccordionContentDirective, ColorInputComponent, SelectComponent, SelectOptionDirective, SelectValueDirective, ScrollableComponent, InputComponent } from '@tetacom/ng-components';
|
|
11
11
|
import * as i1 from '@angular/forms';
|
|
12
12
|
import { FormsModule } from '@angular/forms';
|
|
13
13
|
import { TranslocoPipe } from '@jsverse/transloco';
|
|
@@ -150,6 +150,7 @@ var SeriesType;
|
|
|
150
150
|
SeriesType[SeriesType["scatter"] = 3] = "scatter";
|
|
151
151
|
SeriesType[SeriesType["block"] = 4] = "block";
|
|
152
152
|
SeriesType[SeriesType["blockArea"] = 5] = "blockArea";
|
|
153
|
+
SeriesType[SeriesType["custom"] = 6] = "custom";
|
|
153
154
|
})(SeriesType || (SeriesType = {}));
|
|
154
155
|
|
|
155
156
|
var FillType;
|
|
@@ -1312,9 +1313,10 @@ class ZoomableDirective {
|
|
|
1312
1313
|
this.alive = false;
|
|
1313
1314
|
}
|
|
1314
1315
|
initZoomSync() {
|
|
1315
|
-
combineLatest([this.scaleService.scales, this.zoomService.zoomed])
|
|
1316
|
+
combineLatest([this.scaleService.scales, this.zoomService.zoomed])
|
|
1317
|
+
.pipe(takeWhile(() => this.alive))
|
|
1318
|
+
.subscribe((data) => {
|
|
1316
1319
|
const [scales, zoomed] = data;
|
|
1317
|
-
console.log(zoomed.domain);
|
|
1318
1320
|
if (this._element &&
|
|
1319
1321
|
this.elementRef !== zoomed?.element &&
|
|
1320
1322
|
zoomed?.axis?.index === this.axis.index &&
|
|
@@ -1402,7 +1404,7 @@ class ZoomableDirective {
|
|
|
1402
1404
|
transform = transform.translate(this.currentTransform.x - delta / 2, 0);
|
|
1403
1405
|
}
|
|
1404
1406
|
transform = transform.scale(this.currentTransform.k);
|
|
1405
|
-
|
|
1407
|
+
const domain = this.axis.orientation === AxisOrientation.y
|
|
1406
1408
|
? transform.rescaleY(origin).domain()
|
|
1407
1409
|
: transform.rescaleX(origin).domain();
|
|
1408
1410
|
const extent = this.axis.options?.inverted ? domain : [...domain].reverse();
|
|
@@ -2616,11 +2618,14 @@ class SeriesControlsComponent {
|
|
|
2616
2618
|
this.chartService = inject(ChartService);
|
|
2617
2619
|
this.Align = Align$1;
|
|
2618
2620
|
this.series = input();
|
|
2621
|
+
this.availableSeries = computed(() => {
|
|
2622
|
+
return this.series()?.filter((item) => item.showInControls !== false && item.type !== SeriesType.custom) ?? [];
|
|
2623
|
+
});
|
|
2619
2624
|
this.enabledSeries = computed(() => {
|
|
2620
|
-
return this.
|
|
2625
|
+
return this.availableSeries()?.filter((item) => item.enabled) ?? [];
|
|
2621
2626
|
});
|
|
2622
2627
|
this.disabledSeries = computed(() => {
|
|
2623
|
-
return this.
|
|
2628
|
+
return this.availableSeries()?.filter((item) => !item.enabled) ?? [];
|
|
2624
2629
|
});
|
|
2625
2630
|
this.strokeWidth = [
|
|
2626
2631
|
{ id: 1, value: 1 },
|
|
@@ -2691,7 +2696,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
|
|
|
2691
2696
|
AccordionHeadComponent,
|
|
2692
2697
|
AccordionItemComponent,
|
|
2693
2698
|
AccordionContentDirective,
|
|
2694
|
-
CheckboxComponent,
|
|
2695
2699
|
ColorInputComponent,
|
|
2696
2700
|
FormsModule,
|
|
2697
2701
|
SelectComponent,
|