@tetacom/svg-charts 1.2.9 → 1.2.12
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/model/i-chart-config.d.ts +1 -0
- package/esm2020/chart/chart/chart.component.mjs +3 -3
- package/esm2020/chart/chart-container/chart-container.component.mjs +3 -3
- package/esm2020/chart/core/axis/builders/axis-size-builder.mjs +2 -2
- package/esm2020/chart/directives/zoomable.directive.mjs +4 -1
- package/esm2020/chart/model/i-chart-config.mjs +1 -1
- package/fesm2015/tetacom-svg-charts.mjs +20 -17
- package/fesm2015/tetacom-svg-charts.mjs.map +1 -1
- package/fesm2020/tetacom-svg-charts.mjs +8 -5
- package/fesm2020/tetacom-svg-charts.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -453,7 +453,7 @@ class AxisSizeBuilder {
|
|
|
453
453
|
build(settings) {
|
|
454
454
|
let finalPadding = this.basePadding;
|
|
455
455
|
if (settings.orientation === AxisOrientation.y) {
|
|
456
|
-
const formatter = settings.defaultFormatter();
|
|
456
|
+
const formatter = settings.options.tickFormat || settings.defaultFormatter();
|
|
457
457
|
finalPadding += settings.options.title ? this.titlePadding : 0;
|
|
458
458
|
const scale = settings.defaultScale();
|
|
459
459
|
const ticks = scale().domain(settings.extremes).ticks(20);
|
|
@@ -2004,7 +2004,7 @@ class ZoomableDirective {
|
|
|
2004
2004
|
}
|
|
2005
2005
|
}
|
|
2006
2006
|
ngAfterViewInit() {
|
|
2007
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
2007
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
2008
2008
|
const enable = (((_b = (_a = this.axis) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.zoom) && ((_c = this.axis) === null || _c === void 0 ? void 0 : _c.options.visible) !== false) ||
|
|
2009
2009
|
((_e = (_d = this.config) === null || _d === void 0 ? void 0 : _d.zoom) === null || _e === void 0 ? void 0 : _e.enable);
|
|
2010
2010
|
if (!enable) {
|
|
@@ -2023,31 +2023,34 @@ class ZoomableDirective {
|
|
|
2023
2023
|
[this.size.width, this.size.height],
|
|
2024
2024
|
]);
|
|
2025
2025
|
}
|
|
2026
|
+
if ((_g = this.config.zoom) === null || _g === void 0 ? void 0 : _g.wheelDelta) {
|
|
2027
|
+
this.zoom.wheelDelta((_h = this.config.zoom) === null || _h === void 0 ? void 0 : _h.wheelDelta);
|
|
2028
|
+
}
|
|
2026
2029
|
this.zoomService.axisHashMap.set(this.hash, this.axis);
|
|
2027
2030
|
this.zoomService.elementHashMap.set(this.hash, this._element);
|
|
2028
2031
|
this.zoomService.scaleHashMap.set(this.hash, this.scale);
|
|
2029
2032
|
this.zoomService.zoomHashMap.set(this.hash, this.zoom);
|
|
2030
|
-
this.zoomService.setBroadcastChannel((
|
|
2031
|
-
const maxZoom = ((
|
|
2033
|
+
this.zoomService.setBroadcastChannel((_j = this.config) === null || _j === void 0 ? void 0 : _j.zoom.syncChannel);
|
|
2034
|
+
const maxZoom = ((_k = this.config.zoom) === null || _k === void 0 ? void 0 : _k.max)
|
|
2032
2035
|
? (this.axis.extremes[1] - this.axis.extremes[0]) /
|
|
2033
|
-
((
|
|
2034
|
-
: ((
|
|
2036
|
+
((_l = this.config.zoom) === null || _l === void 0 ? void 0 : _l.max)
|
|
2037
|
+
: ((_m = this.config.zoom) === null || _m === void 0 ? void 0 : _m.limitZoomByData)
|
|
2035
2038
|
? 1
|
|
2036
2039
|
: 0;
|
|
2037
|
-
const minZoom = ((
|
|
2040
|
+
const minZoom = ((_o = this.config.zoom) === null || _o === void 0 ? void 0 : _o.min)
|
|
2038
2041
|
? (this.axis.extremes[1] - this.axis.extremes[0]) /
|
|
2039
|
-
((
|
|
2042
|
+
((_p = this.config.zoom) === null || _p === void 0 ? void 0 : _p.min)
|
|
2040
2043
|
: Infinity;
|
|
2041
2044
|
this.zoom.scaleExtent([maxZoom, minZoom]);
|
|
2042
2045
|
this.zoom.on('zoom end', this.zoomed);
|
|
2043
2046
|
this._element.call(this.zoom).on('dblclick.zoom', null); // Disable dbclick zoom
|
|
2044
2047
|
this.chartService.emitZoomInstance(this.zoomService);
|
|
2045
|
-
if (((
|
|
2048
|
+
if (((_r = (_q = this.config) === null || _q === void 0 ? void 0 : _q.zoom) === null || _r === void 0 ? void 0 : _r.zoomBehavior) === ZoomBehaviorType.wheel) {
|
|
2046
2049
|
this.runWheelZoom();
|
|
2047
2050
|
}
|
|
2048
2051
|
}
|
|
2049
2052
|
// Subscribe to zoom events
|
|
2050
|
-
this.broadcastService.subscribeToZoom((
|
|
2053
|
+
this.broadcastService.subscribeToZoom((_s = this.config) === null || _s === void 0 ? void 0 : _s.zoom.syncChannel).pipe(takeWhile((_) => this.alive), tap$1((m) => {
|
|
2051
2054
|
var _a, _b, _c, _d, _e;
|
|
2052
2055
|
if (this.axis.index === ((_b = (_a = m.message) === null || _a === void 0 ? void 0 : _a.axis) === null || _b === void 0 ? void 0 : _b.index) && this.axis.orientation === ((_d = (_c = m.message) === null || _c === void 0 ? void 0 : _c.axis) === null || _d === void 0 ? void 0 : _d.orientation)) {
|
|
2053
2056
|
const currentZoom = d3.zoomTransform(this._element.node());
|
|
@@ -2089,11 +2092,11 @@ class ZoomableDirective {
|
|
|
2089
2092
|
}))
|
|
2090
2093
|
.subscribe();
|
|
2091
2094
|
// Subscribe to brush events x or y
|
|
2092
|
-
if ((((
|
|
2095
|
+
if ((((_t = this.config.brush) === null || _t === void 0 ? void 0 : _t.type) === BrushType.x &&
|
|
2093
2096
|
this.axis.orientation === AxisOrientation.x) ||
|
|
2094
|
-
(((
|
|
2097
|
+
(((_u = this.config.brush) === null || _u === void 0 ? void 0 : _u.type) === BrushType.y &&
|
|
2095
2098
|
this.axis.orientation === AxisOrientation.y)) {
|
|
2096
|
-
this.broadcastService.subscribeToBrush((
|
|
2099
|
+
this.broadcastService.subscribeToBrush((_v = this.config) === null || _v === void 0 ? void 0 : _v.zoom.syncChannel)
|
|
2097
2100
|
.pipe(combineLatestWith(this.chartService.size), takeWhile((_) => this.alive), filter((data) => {
|
|
2098
2101
|
const [m] = data;
|
|
2099
2102
|
return Boolean(m.message.selection);
|
|
@@ -2475,9 +2478,9 @@ class ChartContainerComponent {
|
|
|
2475
2478
|
const nonOppositeOffsetY = yAxesArray.filter(nonOppositeFilter(axis));
|
|
2476
2479
|
const oppositeOffsetX = xAxesArray.filter(oppositeFilter(axis));
|
|
2477
2480
|
const nonOppositeOffsetX = xAxesArray.filter(nonOppositeFilter(axis));
|
|
2478
|
-
const oppositeTranslateY = oppositeOffsetY.reduce((acc, curr) => acc + curr.selfSize, (_a = config.bounds) === null || _a === void 0 ? void 0 : _a.
|
|
2481
|
+
const oppositeTranslateY = oppositeOffsetY.reduce((acc, curr) => acc + curr.selfSize, (_a = config.bounds) === null || _a === void 0 ? void 0 : _a.right);
|
|
2479
2482
|
const nonOppisteTranslateY = nonOppositeOffsetY.reduce((acc, curr) => acc + curr.selfSize, (_b = config.bounds) === null || _b === void 0 ? void 0 : _b.left);
|
|
2480
|
-
const oppositeTranslateX = oppositeOffsetX.reduce((acc, curr) => acc + curr.selfSize, (_c = config.bounds) === null || _c === void 0 ? void 0 : _c.
|
|
2483
|
+
const oppositeTranslateX = oppositeOffsetX.reduce((acc, curr) => acc + curr.selfSize, (_c = config.bounds) === null || _c === void 0 ? void 0 : _c.top);
|
|
2481
2484
|
const nonOppisteTranslateX = nonOppositeOffsetX.reduce((acc, curr) => acc + curr.selfSize, (_d = config.bounds) === null || _d === void 0 ? void 0 : _d.bottom);
|
|
2482
2485
|
const left = yAxesArray
|
|
2483
2486
|
.filter((_) => _.options.visible && _.options.opposite !== true)
|
|
@@ -2684,10 +2687,10 @@ class ChartComponent {
|
|
|
2684
2687
|
}
|
|
2685
2688
|
}
|
|
2686
2689
|
ChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: ChartComponent, deps: [{ token: ChartService }, { token: ZoomService }, { token: ScaleService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2687
|
-
ChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: ChartComponent, selector: "teta-svg-chart", inputs: { config: "config" }, outputs: { pointerMove: "pointerMove", plotBandsMove: "plotBandsMove", plotBandClick: "plotBandClick", plotBandContextMenu: "plotBandContextMenu", plotLinesMove: "plotLinesMove", pointMove: "pointMove", chartClick: "chartClick", chartContextMenu: "chartContextMenu", annotationContextMenu: "annotationContextMenu", annotationClick: "annotationClick", annotationMove: "annotationMove", zoomServiceInstance: "zoomServiceInstance" }, providers: [ChartService, ZoomService, ScaleService, BrushService], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"{\n hasSeriesData: hasSeriesData | async,\n svcConfig: svcConfig | async\n} as data\">\n <ng-container *ngIf=\"data.hasSeriesData === true else noData\">\n <div class=\"column column_auto\">\n <teta-chart-container class=\"chart-container position-relative\"></teta-chart-container>\n </div>\n <teta-legend *ngIf=\"data.svcConfig.legend?.enable === true\" [series]=\"data.svcConfig.series\"></teta-legend>\n </ng-container>\n</ng-container>\n<ng-template #noData>\n <div class=\"column column_auto
|
|
2690
|
+
ChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.2", type: ChartComponent, selector: "teta-svg-chart", inputs: { config: "config" }, outputs: { pointerMove: "pointerMove", plotBandsMove: "plotBandsMove", plotBandClick: "plotBandClick", plotBandContextMenu: "plotBandContextMenu", plotLinesMove: "plotLinesMove", pointMove: "pointMove", chartClick: "chartClick", chartContextMenu: "chartContextMenu", annotationContextMenu: "annotationContextMenu", annotationClick: "annotationClick", annotationMove: "annotationMove", zoomServiceInstance: "zoomServiceInstance" }, providers: [ChartService, ZoomService, ScaleService, BrushService], usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"{\n hasSeriesData: hasSeriesData | async,\n svcConfig: svcConfig | async\n} as data\">\n <ng-container *ngIf=\"data.hasSeriesData === true else noData\">\n <div class=\"column column_auto\">\n <teta-chart-container class=\"chart-container position-relative\"></teta-chart-container>\n </div>\n <teta-legend *ngIf=\"data.svcConfig.legend?.enable === true\" [series]=\"data.svcConfig.series\"></teta-legend>\n </ng-container>\n</ng-container>\n<ng-template #noData>\n <div class=\"column column_auto justify-content-center\">\n <span class=\"font-body-3 color-text-40\" style=\"overflow: hidden; text-overflow: ellipsis; text-align: center; white-space: nowrap\">\u0414\u0430\u043D\u043D\u044B\u0435 \u043E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044E\u0442</span>\n </div>\n</ng-template>\n", styles: [":host{position:relative;display:flex;flex-direction:column;height:100%;width:100%}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ChartContainerComponent, selector: "teta-chart-container" }, { kind: "component", type: LegendComponent, selector: "teta-legend", inputs: ["series"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2688
2691
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.2", ngImport: i0, type: ChartComponent, decorators: [{
|
|
2689
2692
|
type: Component,
|
|
2690
|
-
args: [{ selector: 'teta-svg-chart', providers: [ChartService, ZoomService, ScaleService, BrushService], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"{\n hasSeriesData: hasSeriesData | async,\n svcConfig: svcConfig | async\n} as data\">\n <ng-container *ngIf=\"data.hasSeriesData === true else noData\">\n <div class=\"column column_auto\">\n <teta-chart-container class=\"chart-container position-relative\"></teta-chart-container>\n </div>\n <teta-legend *ngIf=\"data.svcConfig.legend?.enable === true\" [series]=\"data.svcConfig.series\"></teta-legend>\n </ng-container>\n</ng-container>\n<ng-template #noData>\n <div class=\"column column_auto
|
|
2693
|
+
args: [{ selector: 'teta-svg-chart', providers: [ChartService, ZoomService, ScaleService, BrushService], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"{\n hasSeriesData: hasSeriesData | async,\n svcConfig: svcConfig | async\n} as data\">\n <ng-container *ngIf=\"data.hasSeriesData === true else noData\">\n <div class=\"column column_auto\">\n <teta-chart-container class=\"chart-container position-relative\"></teta-chart-container>\n </div>\n <teta-legend *ngIf=\"data.svcConfig.legend?.enable === true\" [series]=\"data.svcConfig.series\"></teta-legend>\n </ng-container>\n</ng-container>\n<ng-template #noData>\n <div class=\"column column_auto justify-content-center\">\n <span class=\"font-body-3 color-text-40\" style=\"overflow: hidden; text-overflow: ellipsis; text-align: center; white-space: nowrap\">\u0414\u0430\u043D\u043D\u044B\u0435 \u043E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044E\u0442</span>\n </div>\n</ng-template>\n", styles: [":host{position:relative;display:flex;flex-direction:column;height:100%;width:100%}\n"] }]
|
|
2691
2694
|
}], ctorParameters: function () { return [{ type: ChartService }, { type: ZoomService }, { type: ScaleService }]; }, propDecorators: { pointerMove: [{
|
|
2692
2695
|
type: Output
|
|
2693
2696
|
}], plotBandsMove: [{
|