@tetacom/svg-charts 1.7.18 → 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.
@@ -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;
@@ -4,5 +4,6 @@ export declare enum SeriesType {
4
4
  area = 2,
5
5
  scatter = 3,
6
6
  block = 4,
7
- blockArea = 5
7
+ blockArea = 5,
8
+ custom = 6
8
9
  }
@@ -19,6 +19,7 @@ export interface Series<T extends BasePoint> {
19
19
  fillType?: FillType;
20
20
  fillDirection?: FillDirection;
21
21
  showInLegend?: boolean;
22
+ showInControls?: boolean;
22
23
  style?: SvgAttributes;
23
24
  clipPointsDirection?: ClipPointsDirection;
24
25
  }
@@ -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, CheckboxComponent } from '@tetacom/ng-components';
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,12 @@ class ZoomableDirective {
1312
1313
  this.alive = false;
1313
1314
  }
1314
1315
  initZoomSync() {
1315
- combineLatest([this.scaleService.scales, this.zoomService.zoomed]).pipe(takeWhile(() => this.alive)).subscribe((data) => {
1316
+ combineLatest([this.scaleService.scales, this.zoomService.zoomed])
1317
+ .pipe(takeWhile(() => this.alive))
1318
+ .subscribe((data) => {
1316
1319
  const [scales, zoomed] = data;
1317
1320
  if (this._element &&
1321
+ this.elementRef !== zoomed?.element &&
1318
1322
  zoomed?.axis?.index === this.axis.index &&
1319
1323
  zoomed?.axis?.orientation === this.axis.orientation) {
1320
1324
  const axis = this.axis.orientation === AxisOrientation.x ? scales.x.get(this.axis.index) : scales.y.get(this.axis.index);
@@ -1400,7 +1404,7 @@ class ZoomableDirective {
1400
1404
  transform = transform.translate(this.currentTransform.x - delta / 2, 0);
1401
1405
  }
1402
1406
  transform = transform.scale(this.currentTransform.k);
1403
- let domain = this.axis.orientation === AxisOrientation.y
1407
+ const domain = this.axis.orientation === AxisOrientation.y
1404
1408
  ? transform.rescaleY(origin).domain()
1405
1409
  : transform.rescaleX(origin).domain();
1406
1410
  const extent = this.axis.options?.inverted ? domain : [...domain].reverse();
@@ -2614,11 +2618,14 @@ class SeriesControlsComponent {
2614
2618
  this.chartService = inject(ChartService);
2615
2619
  this.Align = Align$1;
2616
2620
  this.series = input();
2621
+ this.availableSeries = computed(() => {
2622
+ return this.series()?.filter((item) => item.showInControls !== false && item.type !== SeriesType.custom) ?? [];
2623
+ });
2617
2624
  this.enabledSeries = computed(() => {
2618
- return this.series()?.filter((item) => item.enabled) ?? [];
2625
+ return this.availableSeries()?.filter((item) => item.enabled) ?? [];
2619
2626
  });
2620
2627
  this.disabledSeries = computed(() => {
2621
- return this.series()?.filter((item) => !item.enabled) ?? [];
2628
+ return this.availableSeries()?.filter((item) => !item.enabled) ?? [];
2622
2629
  });
2623
2630
  this.strokeWidth = [
2624
2631
  { id: 1, value: 1 },
@@ -2689,7 +2696,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
2689
2696
  AccordionHeadComponent,
2690
2697
  AccordionItemComponent,
2691
2698
  AccordionContentDirective,
2692
- CheckboxComponent,
2693
2699
  ColorInputComponent,
2694
2700
  FormsModule,
2695
2701
  SelectComponent,