@tetacom/svg-charts 1.2.26 → 1.2.27

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, Component, Input, ChangeDetectionStrategy, ChangeDetectorRef, HostListener, ElementRef, ViewChild, Directive, HostBinding, EventEmitter, Output, NgModule } from '@angular/core';
2
+ import { Injectable, Component, Input, EventEmitter, Directive, Output, HostListener, ChangeDetectionStrategy, ChangeDetectorRef, ElementRef, ViewChild, HostBinding, NgModule } from '@angular/core';
3
3
  import * as i4 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import { __awaiter } from 'tslib';
@@ -1012,13 +1012,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImpor
1012
1012
  type: Input
1013
1013
  }] } });
1014
1014
 
1015
- var DragPointType;
1016
- (function (DragPointType) {
1017
- DragPointType[DragPointType["x"] = 0] = "x";
1018
- DragPointType[DragPointType["y"] = 1] = "y";
1019
- DragPointType[DragPointType["xy"] = 2] = "xy";
1020
- })(DragPointType || (DragPointType = {}));
1021
-
1022
1015
  class LinearSeriesBase extends SeriesBaseComponent {
1023
1016
  constructor(svc, cdr, scaleService, zoomService, element) {
1024
1017
  super(svc, cdr, scaleService, zoomService, element);
@@ -1028,6 +1021,7 @@ class LinearSeriesBase extends SeriesBaseComponent {
1028
1021
  this.zoomService = zoomService;
1029
1022
  this.element = element;
1030
1023
  this.defaultClipPointsMapping = new Map();
1024
+ this._update = new BehaviorSubject(null);
1031
1025
  }
1032
1026
  set series(series) {
1033
1027
  var _a;
@@ -1068,8 +1062,9 @@ class LinearSeriesBase extends SeriesBaseComponent {
1068
1062
  const [event, { x, y }] = data;
1069
1063
  return this.getTransform(event, x.get(this.series.xAxisIndex).scale, y.get(this.series.yAxisIndex).scale);
1070
1064
  }), tap(() => setTimeout(() => this.cdr.detectChanges())));
1071
- this.path = this.scaleService.scales.pipe(map((data) => {
1065
+ this.path = combineLatest([this.scaleService.scales, this._update]).pipe(map(([data]) => {
1072
1066
  var _a, _b;
1067
+ // console.log(data);
1073
1068
  const { x, y } = data;
1074
1069
  this.x = (_a = x.get(this.series.xAxisIndex)) === null || _a === void 0 ? void 0 : _a.scale;
1075
1070
  this.y = (_b = y.get(this.series.yAxisIndex)) === null || _b === void 0 ? void 0 : _b.scale;
@@ -1101,18 +1096,18 @@ class LinearSeriesBase extends SeriesBaseComponent {
1101
1096
  filteredData = filteredData === null || filteredData === void 0 ? void 0 : filteredData.filter(filter(min, max));
1102
1097
  }
1103
1098
  return line(filteredData);
1104
- }), tap(() => {
1099
+ }), tap((_) => {
1100
+ // console.log(_)
1105
1101
  setTimeout(() => {
1106
1102
  var _a;
1107
1103
  if (((_a = this.markers) === null || _a === void 0 ? void 0 : _a.length) > 0) {
1108
- this.addDragEvents();
1104
+ // this.addDragEvents();
1109
1105
  }
1110
1106
  });
1111
1107
  }));
1112
1108
  }
1113
1109
  ngOnDestroy() {
1114
- var _a;
1115
- (_a = this.markerListeners) === null || _a === void 0 ? void 0 : _a.on('start drag end', null);
1110
+ // this.markerListeners?.on('start drag end', null);
1116
1111
  this.svc.setTooltip({
1117
1112
  point: null,
1118
1113
  series: this.series,
@@ -1121,47 +1116,63 @@ class LinearSeriesBase extends SeriesBaseComponent {
1121
1116
  ngAfterViewInit() {
1122
1117
  }
1123
1118
  addDragEvents() {
1124
- var _a, _b;
1125
- (_a = this.markerListeners) === null || _a === void 0 ? void 0 : _a.on('start drag end', null);
1126
- const drag = (node, event, d) => {
1127
- var _a, _b, _c, _d;
1128
- if (((_a = d.marker) === null || _a === void 0 ? void 0 : _a.dragType) === DragPointType.x ||
1129
- ((_b = d.marker) === null || _b === void 0 ? void 0 : _b.dragType) === DragPointType.xy) {
1130
- d.x = this.x.invert(event.x);
1131
- }
1132
- if (((_c = d.marker) === null || _c === void 0 ? void 0 : _c.dragType) === DragPointType.y ||
1133
- ((_d = d.marker) === null || _d === void 0 ? void 0 : _d.dragType) === DragPointType.xy) {
1134
- d.y = this.y.invert(event.y);
1135
- }
1136
- this.svc.emitPoint({
1137
- target: {
1138
- series: this.series,
1139
- point: d,
1140
- },
1141
- event,
1142
- });
1143
- this.cdr.detectChanges();
1144
- };
1145
- this.markerListeners = d3
1146
- .drag()
1147
- .subject(function (event, d) {
1148
- const node = d3.select(this);
1149
- return { x: node.attr('cx'), y: node.attr('cy') };
1150
- });
1151
- const dragMarkers = this.markerListeners.on('start drag end', function (event, d) {
1152
- const node = d3.select(this);
1153
- drag(node, event, d);
1154
- });
1155
- const draggableMarkers = (_b = this.series.data) === null || _b === void 0 ? void 0 : _b.filter((_) => { var _a; return (_ === null || _ === void 0 ? void 0 : _.marker) && ((_a = _ === null || _ === void 0 ? void 0 : _.marker) === null || _a === void 0 ? void 0 : _a.draggable); });
1156
- const element = d3
1157
- .select(this.element.nativeElement)
1158
- .selectAll('.draggable-marker')
1159
- .data(draggableMarkers);
1160
- element.call(dragMarkers);
1161
- this.svgElement = d3
1162
- .select(this.element.nativeElement)
1163
- .select('.line')
1164
- .node();
1119
+ // this.markerListeners?.on('start drag end', null);
1120
+ // const drag = (node, event: d3.D3DragEvent<any, any, any>, d: BasePoint) => {
1121
+ // if (
1122
+ // d.marker?.dragType === DragPointType.x ||
1123
+ // d.marker?.dragType === DragPointType.xy
1124
+ // ) {
1125
+ // d.x = this.x.invert(event.x);
1126
+ // }
1127
+ //
1128
+ // if (
1129
+ // d.marker?.dragType === DragPointType.y ||
1130
+ // d.marker?.dragType === DragPointType.xy
1131
+ // ) {
1132
+ // d.y = this.y.invert(event.y);
1133
+ // }
1134
+ //
1135
+ // this.svc.emitPoint({
1136
+ // target: {
1137
+ // series: this.series,
1138
+ // point: d,
1139
+ // },
1140
+ // event,
1141
+ // });
1142
+ //
1143
+ // this.cdr.detectChanges();
1144
+ // };
1145
+ // this.markerListeners = d3
1146
+ // .drag()
1147
+ // .subject(function (event, d: BasePoint) {
1148
+ // const node = d3.select(this);
1149
+ // return {x: node.attr('cx'), y: node.attr('cy')};
1150
+ // });
1151
+ // const dragMarkers =
1152
+ // this.markerListeners.on(
1153
+ // 'start drag end',
1154
+ // function (event: d3.D3DragEvent<any, any, any>, d: BasePoint) {
1155
+ // const node = d3.select(this);
1156
+ //
1157
+ // drag(node, event, d);
1158
+ // }
1159
+ // );
1160
+ //
1161
+ // const draggableMarkers = this.series.data?.filter(
1162
+ // (_) => _?.marker && _?.marker?.draggable
1163
+ // );
1164
+ //
1165
+ // const element = d3
1166
+ // .select(this.element.nativeElement)
1167
+ // .selectAll('.draggable-marker')
1168
+ // .data(draggableMarkers);
1169
+ //
1170
+ // element.call(dragMarkers as any);
1171
+ //
1172
+ // this.svgElement = d3
1173
+ // .select(this.element.nativeElement)
1174
+ // .select('.line')
1175
+ // .node() as SVGGeometryElement;
1165
1176
  }
1166
1177
  getTransform(event, scaleX, scaleY) {
1167
1178
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
@@ -1261,6 +1272,150 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImpor
1261
1272
  type: Input
1262
1273
  }] } });
1263
1274
 
1275
+ var DragPointType;
1276
+ (function (DragPointType) {
1277
+ DragPointType[DragPointType["x"] = 0] = "x";
1278
+ DragPointType[DragPointType["y"] = 1] = "y";
1279
+ DragPointType[DragPointType["xy"] = 2] = "xy";
1280
+ })(DragPointType || (DragPointType = {}));
1281
+
1282
+ class DraggablePointDirective {
1283
+ constructor(_elementRef) {
1284
+ this._elementRef = _elementRef;
1285
+ this.moveStart = new EventEmitter();
1286
+ this.moveProcess = new EventEmitter();
1287
+ this.moveEnd = new EventEmitter();
1288
+ }
1289
+ mouseDown(event) {
1290
+ if (!this.tetaDraggablePoint) {
1291
+ return;
1292
+ }
1293
+ event.stopPropagation();
1294
+ event.preventDefault();
1295
+ this.startPosition = {
1296
+ x: event.x,
1297
+ y: event.y
1298
+ };
1299
+ this.moveStart.emit(this.startPosition);
1300
+ }
1301
+ mouseUp(event) {
1302
+ if (this.startPosition !== null && this.startPosition !== undefined) {
1303
+ let deltaX = event.x - this.startPosition.x;
1304
+ let deltaY = event.y - this.startPosition.y;
1305
+ if (this.dragDirection === DragPointType.x) {
1306
+ deltaY = 0;
1307
+ }
1308
+ if (this.dragDirection === DragPointType.y) {
1309
+ deltaX = 0;
1310
+ }
1311
+ if (this.allowDrag && !this.allowDrag({
1312
+ x: event.x,
1313
+ y: event.y,
1314
+ deltaX,
1315
+ deltaY
1316
+ })) {
1317
+ return;
1318
+ }
1319
+ if (this.transformCache) {
1320
+ this.transformCache.x = this.transformCache.x + deltaX;
1321
+ this.transformCache.y = this.transformCache.y + deltaY;
1322
+ }
1323
+ else {
1324
+ this.transformCache = {
1325
+ x: deltaX,
1326
+ y: deltaY
1327
+ };
1328
+ }
1329
+ this.moveEnd.emit({
1330
+ x: event.x,
1331
+ y: event.y,
1332
+ deltaX,
1333
+ deltaY
1334
+ });
1335
+ }
1336
+ this.startPosition = null;
1337
+ }
1338
+ mouseMove(event) {
1339
+ if (this.startPosition) {
1340
+ let deltaX = event.x - this.startPosition.x;
1341
+ let deltaY = event.y - this.startPosition.y;
1342
+ if (this.transformCache) {
1343
+ deltaX = this.transformCache.x + deltaX;
1344
+ deltaY = this.transformCache.y + deltaY;
1345
+ }
1346
+ if (this.allowDrag && !this.allowDrag({
1347
+ x: event.x,
1348
+ y: event.y,
1349
+ deltaX,
1350
+ deltaY
1351
+ })) {
1352
+ return;
1353
+ }
1354
+ if (this.dragDirection === DragPointType.x) {
1355
+ deltaY = 0;
1356
+ }
1357
+ if (this.dragDirection === DragPointType.y) {
1358
+ deltaX = 0;
1359
+ }
1360
+ this.setTransform(deltaX, deltaY);
1361
+ event.stopPropagation();
1362
+ event.preventDefault();
1363
+ this.moveProcess.emit({
1364
+ x: event.x,
1365
+ y: event.y,
1366
+ deltaX,
1367
+ deltaY
1368
+ });
1369
+ }
1370
+ }
1371
+ setTransform(x, y) {
1372
+ this._elementRef.nativeElement.style.transform = `translate(${x}px, ${y}px)`;
1373
+ }
1374
+ resetTransform() {
1375
+ this.setTransform(0, 0);
1376
+ this.transformCache = null;
1377
+ }
1378
+ }
1379
+ DraggablePointDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: DraggablePointDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
1380
+ DraggablePointDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.2", type: DraggablePointDirective, selector: "[tetaDraggablePoint]", inputs: { tetaDraggablePoint: "tetaDraggablePoint", dragDirection: "dragDirection", allowDrag: "allowDrag" }, outputs: { moveStart: "moveStart", moveProcess: "moveProcess", moveEnd: "moveEnd" }, host: { listeners: { "mousedown": "mouseDown($event)", "touchstart": "mouseDown($event)", "window:mouseup": "mouseUp($event)", "window:touchend": "mouseUp($event)", "window:mousemove": "mouseMove($event)", "window:touchmove": "mouseMove($event)" } }, exportAs: ["tetaDraggablePoint"], ngImport: i0 });
1381
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: DraggablePointDirective, decorators: [{
1382
+ type: Directive,
1383
+ args: [{
1384
+ selector: '[tetaDraggablePoint]',
1385
+ exportAs: 'tetaDraggablePoint'
1386
+ }]
1387
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { tetaDraggablePoint: [{
1388
+ type: Input
1389
+ }], dragDirection: [{
1390
+ type: Input
1391
+ }], allowDrag: [{
1392
+ type: Input
1393
+ }], moveStart: [{
1394
+ type: Output
1395
+ }], moveProcess: [{
1396
+ type: Output
1397
+ }], moveEnd: [{
1398
+ type: Output
1399
+ }], mouseDown: [{
1400
+ type: HostListener,
1401
+ args: ['mousedown', ['$event']]
1402
+ }, {
1403
+ type: HostListener,
1404
+ args: ['touchstart', ['$event']]
1405
+ }], mouseUp: [{
1406
+ type: HostListener,
1407
+ args: ['window:mouseup', ['$event']]
1408
+ }, {
1409
+ type: HostListener,
1410
+ args: ['window:touchend', ['$event']]
1411
+ }], mouseMove: [{
1412
+ type: HostListener,
1413
+ args: ['window:mousemove', ['$event']]
1414
+ }, {
1415
+ type: HostListener,
1416
+ args: ['window:touchmove', ['$event']]
1417
+ }] } });
1418
+
1264
1419
  class LineSeriesComponent extends LinearSeriesBase {
1265
1420
  constructor(svc, cdr, scaleService, zoomService, element) {
1266
1421
  super(svc, cdr, scaleService, zoomService, element);
@@ -1269,13 +1424,64 @@ class LineSeriesComponent extends LinearSeriesBase {
1269
1424
  this.scaleService = scaleService;
1270
1425
  this.zoomService = zoomService;
1271
1426
  this.element = element;
1427
+ this.allowDrag = (point) => {
1428
+ return (newPoint) => {
1429
+ if (point.marker.minX !== null && point.marker.minX !== undefined) {
1430
+ if (this.x.invert(this.x(this.start.x) + newPoint.deltaX) < point.marker.minX) {
1431
+ return false;
1432
+ }
1433
+ }
1434
+ if (point.marker.maxX !== null && point.marker.maxX !== undefined) {
1435
+ if (this.x.invert(this.x(this.start.x) + newPoint.deltaX) > point.marker.minX) {
1436
+ return false;
1437
+ }
1438
+ }
1439
+ if (point.marker.minY !== null && point.marker.minY !== undefined) {
1440
+ if (this.y.invert(this.y(this.start.y) + newPoint.deltaY) < point.marker.minY) {
1441
+ return false;
1442
+ }
1443
+ }
1444
+ if (point.marker.maxY !== null && point.marker.maxY !== undefined) {
1445
+ if (this.y.invert(this.y(this.start.y) + newPoint.deltaY) > point.marker.maxY) {
1446
+ return false;
1447
+ }
1448
+ }
1449
+ return true;
1450
+ };
1451
+ };
1452
+ }
1453
+ moveStart(event, point) {
1454
+ this.start = { x: point.x, y: point.y };
1455
+ }
1456
+ moveEnd(event, point) {
1457
+ point.x = this.x.invert(this.x(this.start.x) + event.deltaX);
1458
+ point.y = this.y.invert(this.y(this.start.y) + event.deltaY);
1459
+ this._update.next();
1460
+ this.svc.emitPoint({
1461
+ target: event
1462
+ });
1463
+ }
1464
+ moveProcess(event, point) {
1465
+ point.x = this.x.invert(this.x(this.start.x) + event.deltaX);
1466
+ point.y = this.y.invert(this.y(this.start.y) + event.deltaY);
1467
+ this._update.next();
1468
+ this.svc.emitPoint({
1469
+ target: event
1470
+ });
1471
+ }
1472
+ startLabel(event, label) {
1473
+ this.labelStart = { dx: label.dx, dy: label.dy };
1474
+ }
1475
+ moveLabel(event, label) {
1476
+ label.dx = this.labelStart.dx + event.deltaX;
1477
+ label.dy = this.labelStart.dy + event.deltaY;
1272
1478
  }
1273
1479
  }
1274
1480
  LineSeriesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: LineSeriesComponent, deps: [{ token: ChartService }, { token: i0.ChangeDetectorRef }, { token: ScaleService }, { token: ZoomService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
1275
- LineSeriesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: LineSeriesComponent, selector: "svg:svg[teta-line-series]", usesInheritance: true, ngImport: i0, template: "<svg:path\n class=\"line\"\n [attr.d]=\"path | async\"\n [attr.stroke]=\"series.color\"\n [attr.stroke-dasharray]=\"series.style?.strokeDasharray\"\n [attr.stroke-width]=\"series.style?.strokeWidth\"\n fill=\"none\">\n</svg:path>\n<ng-container *ngIf=\"transform | async as t\">\n <svg:circle\n *ngIf=\"t?.x !=null && t?.y!=null\"\n r=\"3\"\n [attr.fill]=\"series.color\"\n [attr.transform]=\"'translate('+ t.x +', '+ t.y +')'\"\n >\n </svg:circle>\n</ng-container>\n<ng-container *ngIf=\"markers as draggablePoints\">\n <svg:circle\n class=\"marker\"\n *ngFor=\"let point of draggablePoints\"\n [class.draggable-marker]=\"point?.marker?.draggable\"\n [attr.r]=\"point.marker.style?.radius ?? 5\"\n [attr.fill]=\"point.marker.style?.fill ?? 'transparent'\"\n [attr.stroke]=\"point.marker.style?.stroke ?? 'none'\"\n [attr.stroke-width]=\"point.marker.style?.strokeWidth\"\n [attr.stroke-dasharray]=\"point.marker.style?.strokeDasharray\"\n [attr.cx]=\"x(point.x)\"\n [attr.cy]=\"y(point.y)\"\n >\n </svg:circle>\n</ng-container>\n\n\n\n", styles: [".draggable-marker{cursor:move}.active{stroke-opacity:.5}.marker-grab{opacity:0}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1481
+ LineSeriesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: LineSeriesComponent, selector: "svg:svg[teta-line-series]", usesInheritance: true, ngImport: i0, template: "<svg:path\n class=\"line\"\n [attr.d]=\"path | async\"\n [attr.stroke]=\"series.color\"\n [attr.stroke-dasharray]=\"series.style?.strokeDasharray\"\n [attr.stroke-width]=\"series.style?.strokeWidth\"\n fill=\"none\">\n</svg:path>\n<ng-container *ngIf=\"transform | async as t\">\n <svg:circle\n *ngIf=\"t?.x !=null && t?.y!=null\"\n r=\"3\"\n [attr.fill]=\"series.color\"\n [attr.transform]=\"'translate('+ t.x +', '+ t.y +')'\"\n >\n </svg:circle>\n</ng-container>\n<ng-container *ngIf=\"markers as draggablePoints\">\n <svg:g\n *ngFor=\"let point of draggablePoints\"\n [attr.transform]=\"'translate(' + x(point.x)+ ',' +y(point.y) + ')'\">\n <svg:g [tetaDraggablePoint]=\"point.marker.draggable\"\n [dragDirection]=\"point.marker.dragType\"\n [allowDrag]=\"allowDrag(point)\"\n #dragPoint=\"tetaDraggablePoint\"\n (moveStart)=\"moveStart($event, point)\"\n (moveEnd)=\"moveEnd($event, point);dragPoint.resetTransform();\"\n (moveProcess)=\"moveProcess($event, point);dragPoint.resetTransform();\"\n [class.draggable-marker]=\"point?.marker?.draggable\">\n <svg:circle\n class=\"marker\"\n [attr.r]=\"point.marker.style?.radius ?? 5\"\n [attr.fill]=\"point.marker.style?.fill ?? 'transparent'\"\n [attr.stroke]=\"point.marker.style?.stroke ?? 'none'\"\n [attr.stroke-width]=\"point.marker.style?.strokeWidth\"\n [attr.stroke-dasharray]=\"point.marker.style?.strokeDasharray\"\n [attr.cx]=\"0\"\n [attr.cy]=\"0\">\n </svg:circle>\n <ng-container *ngIf=\"point.marker.label?.text\">\n <svg:line\n [attr.x1]=\"0\"\n [attr.y1]=\"0\"\n [attr.x2]=\"point.marker.label?.dx\"\n [attr.y2]=\"point.marker.label?.dy\"\n [attr.stroke]=\"point.marker.label?.style?.stroke ?? 'var(--color-text-90)'\"\n [attr.stroke-width]=\"point.marker.label?.style?.strokeWidth ?? 1\"\n [attr.stroke-dasharray]=\"point.marker.label?.style?.strokeDasharray ?? null\">\n </svg:line>\n <svg:foreignObject\n [tetaDraggablePoint]=\"point.marker.label?.draggable\"\n [dragDirection]=\"point.marker.label.dragType\"\n #labelPoint=\"tetaDraggablePoint\"\n (moveStart)=\"startLabel($event, point.marker.label)\"\n (moveProcess)=\"moveLabel($event, point.marker.label); labelPoint.resetTransform();\"\n (moveEnd)=\"labelPoint.resetTransform();\"\n [attr.width]=\"annotationNode?.offsetWidth ?? 0\"\n [attr.height]=\"annotationNode?.offsetHeight ?? 0\"\n [attr.x]=\"point.marker.label?.dx\"\n [attr.y]=\"point.marker.label?.dy\"\n class=\"position-absolute\">\n <div\n #annotationNode\n class=\"shadow-2 padding-2\"\n [style.color]=\"'var(--color-text-90)'\"\n [style.background-color]=\"'var(--color-background-50)'\"\n [style.cursor]=\"'move'\"\n style=\"border-radius: 2px; display: inline-block;\">\n {{point.marker.label?.text}}\n </div>\n </svg:foreignObject>\n </ng-container>\n </svg:g>\n </svg:g>\n</ng-container>\n\n\n\n", styles: [".draggable-marker{cursor:move}.active{stroke-opacity:.5}.marker-grab{opacity:0}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: DraggablePointDirective, selector: "[tetaDraggablePoint]", inputs: ["tetaDraggablePoint", "dragDirection", "allowDrag"], outputs: ["moveStart", "moveProcess", "moveEnd"], exportAs: ["tetaDraggablePoint"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1276
1482
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: LineSeriesComponent, decorators: [{
1277
1483
  type: Component,
1278
- args: [{ selector: 'svg:svg[teta-line-series]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg:path\n class=\"line\"\n [attr.d]=\"path | async\"\n [attr.stroke]=\"series.color\"\n [attr.stroke-dasharray]=\"series.style?.strokeDasharray\"\n [attr.stroke-width]=\"series.style?.strokeWidth\"\n fill=\"none\">\n</svg:path>\n<ng-container *ngIf=\"transform | async as t\">\n <svg:circle\n *ngIf=\"t?.x !=null && t?.y!=null\"\n r=\"3\"\n [attr.fill]=\"series.color\"\n [attr.transform]=\"'translate('+ t.x +', '+ t.y +')'\"\n >\n </svg:circle>\n</ng-container>\n<ng-container *ngIf=\"markers as draggablePoints\">\n <svg:circle\n class=\"marker\"\n *ngFor=\"let point of draggablePoints\"\n [class.draggable-marker]=\"point?.marker?.draggable\"\n [attr.r]=\"point.marker.style?.radius ?? 5\"\n [attr.fill]=\"point.marker.style?.fill ?? 'transparent'\"\n [attr.stroke]=\"point.marker.style?.stroke ?? 'none'\"\n [attr.stroke-width]=\"point.marker.style?.strokeWidth\"\n [attr.stroke-dasharray]=\"point.marker.style?.strokeDasharray\"\n [attr.cx]=\"x(point.x)\"\n [attr.cy]=\"y(point.y)\"\n >\n </svg:circle>\n</ng-container>\n\n\n\n", styles: [".draggable-marker{cursor:move}.active{stroke-opacity:.5}.marker-grab{opacity:0}\n"] }]
1484
+ args: [{ selector: 'svg:svg[teta-line-series]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<svg:path\n class=\"line\"\n [attr.d]=\"path | async\"\n [attr.stroke]=\"series.color\"\n [attr.stroke-dasharray]=\"series.style?.strokeDasharray\"\n [attr.stroke-width]=\"series.style?.strokeWidth\"\n fill=\"none\">\n</svg:path>\n<ng-container *ngIf=\"transform | async as t\">\n <svg:circle\n *ngIf=\"t?.x !=null && t?.y!=null\"\n r=\"3\"\n [attr.fill]=\"series.color\"\n [attr.transform]=\"'translate('+ t.x +', '+ t.y +')'\"\n >\n </svg:circle>\n</ng-container>\n<ng-container *ngIf=\"markers as draggablePoints\">\n <svg:g\n *ngFor=\"let point of draggablePoints\"\n [attr.transform]=\"'translate(' + x(point.x)+ ',' +y(point.y) + ')'\">\n <svg:g [tetaDraggablePoint]=\"point.marker.draggable\"\n [dragDirection]=\"point.marker.dragType\"\n [allowDrag]=\"allowDrag(point)\"\n #dragPoint=\"tetaDraggablePoint\"\n (moveStart)=\"moveStart($event, point)\"\n (moveEnd)=\"moveEnd($event, point);dragPoint.resetTransform();\"\n (moveProcess)=\"moveProcess($event, point);dragPoint.resetTransform();\"\n [class.draggable-marker]=\"point?.marker?.draggable\">\n <svg:circle\n class=\"marker\"\n [attr.r]=\"point.marker.style?.radius ?? 5\"\n [attr.fill]=\"point.marker.style?.fill ?? 'transparent'\"\n [attr.stroke]=\"point.marker.style?.stroke ?? 'none'\"\n [attr.stroke-width]=\"point.marker.style?.strokeWidth\"\n [attr.stroke-dasharray]=\"point.marker.style?.strokeDasharray\"\n [attr.cx]=\"0\"\n [attr.cy]=\"0\">\n </svg:circle>\n <ng-container *ngIf=\"point.marker.label?.text\">\n <svg:line\n [attr.x1]=\"0\"\n [attr.y1]=\"0\"\n [attr.x2]=\"point.marker.label?.dx\"\n [attr.y2]=\"point.marker.label?.dy\"\n [attr.stroke]=\"point.marker.label?.style?.stroke ?? 'var(--color-text-90)'\"\n [attr.stroke-width]=\"point.marker.label?.style?.strokeWidth ?? 1\"\n [attr.stroke-dasharray]=\"point.marker.label?.style?.strokeDasharray ?? null\">\n </svg:line>\n <svg:foreignObject\n [tetaDraggablePoint]=\"point.marker.label?.draggable\"\n [dragDirection]=\"point.marker.label.dragType\"\n #labelPoint=\"tetaDraggablePoint\"\n (moveStart)=\"startLabel($event, point.marker.label)\"\n (moveProcess)=\"moveLabel($event, point.marker.label); labelPoint.resetTransform();\"\n (moveEnd)=\"labelPoint.resetTransform();\"\n [attr.width]=\"annotationNode?.offsetWidth ?? 0\"\n [attr.height]=\"annotationNode?.offsetHeight ?? 0\"\n [attr.x]=\"point.marker.label?.dx\"\n [attr.y]=\"point.marker.label?.dy\"\n class=\"position-absolute\">\n <div\n #annotationNode\n class=\"shadow-2 padding-2\"\n [style.color]=\"'var(--color-text-90)'\"\n [style.background-color]=\"'var(--color-background-50)'\"\n [style.cursor]=\"'move'\"\n style=\"border-radius: 2px; display: inline-block;\">\n {{point.marker.label?.text}}\n </div>\n </svg:foreignObject>\n </ng-container>\n </svg:g>\n </svg:g>\n</ng-container>\n\n\n\n", styles: [".draggable-marker{cursor:move}.active{stroke-opacity:.5}.marker-grab{opacity:0}\n"] }]
1279
1485
  }], ctorParameters: function () { return [{ type: ChartService }, { type: i0.ChangeDetectorRef }, { type: ScaleService }, { type: ZoomService }, { type: i0.ElementRef }]; } });
1280
1486
 
1281
1487
  class BarSeriesComponent extends SeriesBaseComponent {
@@ -1615,7 +1821,7 @@ class XAxisComponent {
1615
1821
  this.ticks = this.x.pipe(withLatestFrom(this._svc.size), map((_) => {
1616
1822
  const [x, size] = _;
1617
1823
  const tickSize = x.ticks().map((_) => getTextWidth(this.axis.options.tickFormat ? this.axis.options.tickFormat(_) : this.axis.defaultFormatter()(_), 0.45, 11));
1618
- return x.ticks(size.width / parseInt(d3.max(tickSize), 10) / 3);
1824
+ return x.ticks(size.width / parseInt(d3.max(tickSize), 10) / 10);
1619
1825
  }));
1620
1826
  }
1621
1827
  getLabelTransform() {
@@ -2794,7 +3000,8 @@ ChartModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "1
2794
3000
  BlockSeriesComponent,
2795
3001
  BlockAreaSeriesComponent,
2796
3002
  AnnotationComponent,
2797
- CrosshairComponent], imports: [CommonModule, LetModule], exports: [ChartComponent,
3003
+ CrosshairComponent,
3004
+ DraggablePointDirective], imports: [CommonModule, LetModule], exports: [ChartComponent,
2798
3005
  LegendComponent,
2799
3006
  SeriesBaseComponent,
2800
3007
  LineSeriesComponent,
@@ -2830,6 +3037,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImpor
2830
3037
  BlockAreaSeriesComponent,
2831
3038
  AnnotationComponent,
2832
3039
  CrosshairComponent,
3040
+ DraggablePointDirective,
2833
3041
  ],
2834
3042
  exports: [
2835
3043
  ChartComponent,