@swimlane/ngx-charts 25.0.0 → 25.0.1

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/CHANGELOG.md CHANGED
@@ -2,9 +2,22 @@
2
2
 
3
3
  ## HEAD (unreleased)
4
4
 
5
+ ## 25.0.1
6
+
7
+ - Chore: Sync 25.x release with master (includes maintenance fixes already present on git that were missing from the original npm 25.0.0 publish)
8
+
5
9
  ## 25.0.0
6
10
 
7
11
  - Enhancement: Added support for Angular 22
12
+ - Breaking: Dropped support for Angular 19 and 20 (requires Angular 21.2+)
13
+
14
+ ## 24.0.2
15
+
16
+ - Fix: Side legend labels now truncate with CSS ellipsis instead of being hard-clipped when the legend width is constrained
17
+
18
+ ## 24.0.1
19
+
20
+ - Fix: Y-axis labels were cut off, misaligned when server-side rendered.
8
21
 
9
22
  ## 24.0.0
10
23
 
@@ -688,7 +688,13 @@ class LegendEntryComponent {
688
688
  }
689
689
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: LegendEntryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
690
690
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: LegendEntryComponent, isStandalone: false, selector: "ngx-charts-legend-entry", inputs: { color: "color", label: "label", formattedLabel: "formattedLabel", isActive: "isActive" }, outputs: { select: "select", activate: "activate", deactivate: "deactivate", toggle: "toggle" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()" } }, ngImport: i0, template: `
691
- <span [title]="formattedLabel" tabindex="-1" [class.active]="isActive" (click)="select.emit(formattedLabel)">
691
+ <span
692
+ [title]="formattedLabel"
693
+ tabindex="-1"
694
+ class="legend-entry"
695
+ [class.active]="isActive"
696
+ (click)="select.emit(formattedLabel)"
697
+ >
692
698
  <span class="legend-label-color" [style.background-color]="color" (click)="toggle.emit(formattedLabel)"> </span>
693
699
  <span class="legend-label-text">
694
700
  {{ trimmedLabel }}
@@ -701,7 +707,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
701
707
  args: [{
702
708
  selector: 'ngx-charts-legend-entry',
703
709
  template: `
704
- <span [title]="formattedLabel" tabindex="-1" [class.active]="isActive" (click)="select.emit(formattedLabel)">
710
+ <span
711
+ [title]="formattedLabel"
712
+ tabindex="-1"
713
+ class="legend-entry"
714
+ [class.active]="isActive"
715
+ (click)="select.emit(formattedLabel)"
716
+ >
705
717
  <span class="legend-label-color" [style.background-color]="color" (click)="toggle.emit(formattedLabel)"> </span>
706
718
  <span class="legend-label-text">
707
719
  {{ trimmedLabel }}
@@ -792,7 +804,13 @@ class LegendComponent {
792
804
  <span class="legend-title-text">{{ title }}</span>
793
805
  </header>
794
806
  <div class="legend-wrap">
795
- <ul class="legend-labels" [class.horizontal-legend]="horizontal" [style.max-height.px]="height - 45">
807
+ <ul
808
+ class="legend-labels"
809
+ [class.horizontal-legend]="horizontal"
810
+ [class.vertical-legend]="!horizontal"
811
+ [style.max-height.px]="!horizontal ? height - 45 : null"
812
+ [style.max-width.px]="horizontal && width ? width - 10 : null"
813
+ >
796
814
  <li *ngFor="let entry of legendEntries; trackBy: trackBy" class="legend-label">
797
815
  <ngx-charts-legend-entry
798
816
  [label]="entry.label"
@@ -808,7 +826,7 @@ class LegendComponent {
808
826
  </ul>
809
827
  </div>
810
828
  </div>
811
- `, isInline: true, styles: [".chart-legend{display:inline-block;padding:0;width:auto!important}.chart-legend .legend-title{white-space:nowrap;overflow:hidden;margin-left:10px;margin-bottom:5px;font-size:14px;font-weight:700}.chart-legend ul,.chart-legend li{padding:0;margin:0;list-style:none}.chart-legend .horizontal-legend li{display:inline-block}.chart-legend .legend-wrap{width:calc(100% - 10px)}.chart-legend .legend-labels{line-height:85%;list-style:none;text-align:left;float:left;width:100%;border-radius:3px;overflow-y:auto;overflow-x:hidden;white-space:nowrap;background:#0000000d}.chart-legend .legend-label{cursor:pointer;font-size:90%;margin:8px;color:#afb7c8}.chart-legend .legend-label:hover{color:#000;-webkit-transition:.2s;-moz-transition:.2s;transition:.2s}.chart-legend .legend-label .active .legend-label-text{color:#000}.chart-legend .legend-label-color{display:inline-block;height:15px;width:15px;margin-right:5px;color:#5b646b;border-radius:3px}.chart-legend .legend-label-text{display:inline-block;vertical-align:top;line-height:15px;font-size:12px;width:calc(100% - 20px);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.chart-legend .legend-title-text{vertical-align:bottom;display:inline-block;line-height:16px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: LegendEntryComponent, selector: "ngx-charts-legend-entry", inputs: ["color", "label", "formattedLabel", "isActive"], outputs: ["select", "activate", "deactivate", "toggle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
829
+ `, isInline: true, styles: [".chart-legend{display:inline-block;padding:0;max-width:100%;box-sizing:border-box;overflow:hidden;vertical-align:top}.chart-legend .legend-title{white-space:nowrap;overflow:hidden;margin-left:10px;margin-bottom:5px;font-size:14px;font-weight:700}.chart-legend ul,.chart-legend li{padding:0;margin:0;list-style:none}.chart-legend .vertical-legend .legend-label{width:100%;max-width:calc(100% - 20px)}.chart-legend .vertical-legend .legend-entry{display:flex;flex-grow:1;align-items:center;overflow:hidden}.chart-legend .legend-wrap{width:calc(100% - 10px);min-width:0}.chart-legend .legend-labels{line-height:85%;list-style:none;text-align:left;display:flex;flex-wrap:wrap;white-space:nowrap;border-radius:3px;background:#0000000d}.chart-legend .legend-labels.vertical-legend{overflow-x:hidden;overflow-y:auto}.chart-legend .legend-labels.horizontal-legend{max-width:100%;overflow-x:auto;overflow-y:hidden}.chart-legend .legend-labels.horizontal-legend li{display:inline-block}.chart-legend .legend-label{cursor:pointer;font-size:90%;margin:8px;color:#afb7c8}.chart-legend .legend-label:hover{color:#000;-webkit-transition:.2s;-moz-transition:.2s;transition:.2s}.chart-legend .legend-label .active .legend-label-text{color:#000}.chart-legend .legend-label-color{display:inline-block;height:15px;width:15px;min-width:15px;margin-right:5px;color:#5b646b;border-radius:3px}.chart-legend .legend-label-text{display:inline-block;vertical-align:top;line-height:15px;font-size:12px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.chart-legend .legend-title-text{vertical-align:bottom;display:inline-block;line-height:16px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: LegendEntryComponent, selector: "ngx-charts-legend-entry", inputs: ["color", "label", "formattedLabel", "isActive"], outputs: ["select", "activate", "deactivate", "toggle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
812
830
  }
813
831
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: LegendComponent, decorators: [{
814
832
  type: Component,
@@ -818,7 +836,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
818
836
  <span class="legend-title-text">{{ title }}</span>
819
837
  </header>
820
838
  <div class="legend-wrap">
821
- <ul class="legend-labels" [class.horizontal-legend]="horizontal" [style.max-height.px]="height - 45">
839
+ <ul
840
+ class="legend-labels"
841
+ [class.horizontal-legend]="horizontal"
842
+ [class.vertical-legend]="!horizontal"
843
+ [style.max-height.px]="!horizontal ? height - 45 : null"
844
+ [style.max-width.px]="horizontal && width ? width - 10 : null"
845
+ >
822
846
  <li *ngFor="let entry of legendEntries; trackBy: trackBy" class="legend-label">
823
847
  <ngx-charts-legend-entry
824
848
  [label]="entry.label"
@@ -834,7 +858,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
834
858
  </ul>
835
859
  </div>
836
860
  </div>
837
- `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, styles: [".chart-legend{display:inline-block;padding:0;width:auto!important}.chart-legend .legend-title{white-space:nowrap;overflow:hidden;margin-left:10px;margin-bottom:5px;font-size:14px;font-weight:700}.chart-legend ul,.chart-legend li{padding:0;margin:0;list-style:none}.chart-legend .horizontal-legend li{display:inline-block}.chart-legend .legend-wrap{width:calc(100% - 10px)}.chart-legend .legend-labels{line-height:85%;list-style:none;text-align:left;float:left;width:100%;border-radius:3px;overflow-y:auto;overflow-x:hidden;white-space:nowrap;background:#0000000d}.chart-legend .legend-label{cursor:pointer;font-size:90%;margin:8px;color:#afb7c8}.chart-legend .legend-label:hover{color:#000;-webkit-transition:.2s;-moz-transition:.2s;transition:.2s}.chart-legend .legend-label .active .legend-label-text{color:#000}.chart-legend .legend-label-color{display:inline-block;height:15px;width:15px;margin-right:5px;color:#5b646b;border-radius:3px}.chart-legend .legend-label-text{display:inline-block;vertical-align:top;line-height:15px;font-size:12px;width:calc(100% - 20px);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.chart-legend .legend-title-text{vertical-align:bottom;display:inline-block;line-height:16px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}\n"] }]
861
+ `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, styles: [".chart-legend{display:inline-block;padding:0;max-width:100%;box-sizing:border-box;overflow:hidden;vertical-align:top}.chart-legend .legend-title{white-space:nowrap;overflow:hidden;margin-left:10px;margin-bottom:5px;font-size:14px;font-weight:700}.chart-legend ul,.chart-legend li{padding:0;margin:0;list-style:none}.chart-legend .vertical-legend .legend-label{width:100%;max-width:calc(100% - 20px)}.chart-legend .vertical-legend .legend-entry{display:flex;flex-grow:1;align-items:center;overflow:hidden}.chart-legend .legend-wrap{width:calc(100% - 10px);min-width:0}.chart-legend .legend-labels{line-height:85%;list-style:none;text-align:left;display:flex;flex-wrap:wrap;white-space:nowrap;border-radius:3px;background:#0000000d}.chart-legend .legend-labels.vertical-legend{overflow-x:hidden;overflow-y:auto}.chart-legend .legend-labels.horizontal-legend{max-width:100%;overflow-x:auto;overflow-y:hidden}.chart-legend .legend-labels.horizontal-legend li{display:inline-block}.chart-legend .legend-label{cursor:pointer;font-size:90%;margin:8px;color:#afb7c8}.chart-legend .legend-label:hover{color:#000;-webkit-transition:.2s;-moz-transition:.2s;transition:.2s}.chart-legend .legend-label .active .legend-label-text{color:#000}.chart-legend .legend-label-color{display:inline-block;height:15px;width:15px;min-width:15px;margin-right:5px;color:#5b646b;border-radius:3px}.chart-legend .legend-label-text{display:inline-block;vertical-align:top;line-height:15px;font-size:12px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.chart-legend .legend-title-text{vertical-align:bottom;display:inline-block;line-height:16px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}\n"] }]
838
862
  }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { data: [{
839
863
  type: Input
840
864
  }], title: [{
@@ -973,6 +997,8 @@ class ChartComponent {
973
997
  <ngx-charts-scale-legend
974
998
  *ngIf="showLegend && legendType === LegendType.ScaleLegend"
975
999
  class="chart-legend"
1000
+ [style.width.px]="legendWidth"
1001
+ [style.maxWidth.px]="legendWidth"
976
1002
  [horizontal]="legendOptions && legendOptions.position === LegendPosition.Below"
977
1003
  [valueRange]="legendOptions.domain"
978
1004
  [colors]="legendOptions.colors"
@@ -983,6 +1009,8 @@ class ChartComponent {
983
1009
  <ngx-charts-legend
984
1010
  *ngIf="showLegend && legendType === LegendType.Legend"
985
1011
  class="chart-legend"
1012
+ [style.width.px]="legendWidth"
1013
+ [style.maxWidth.px]="legendWidth"
986
1014
  [horizontal]="legendOptions && legendOptions.position === LegendPosition.Below"
987
1015
  [data]="legendOptions.domain"
988
1016
  [title]="legendOptions.title"
@@ -1011,6 +1039,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
1011
1039
  <ngx-charts-scale-legend
1012
1040
  *ngIf="showLegend && legendType === LegendType.ScaleLegend"
1013
1041
  class="chart-legend"
1042
+ [style.width.px]="legendWidth"
1043
+ [style.maxWidth.px]="legendWidth"
1014
1044
  [horizontal]="legendOptions && legendOptions.position === LegendPosition.Below"
1015
1045
  [valueRange]="legendOptions.domain"
1016
1046
  [colors]="legendOptions.colors"
@@ -1021,6 +1051,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
1021
1051
  <ngx-charts-legend
1022
1052
  *ngIf="showLegend && legendType === LegendType.Legend"
1023
1053
  class="chart-legend"
1054
+ [style.width.px]="legendWidth"
1055
+ [style.maxWidth.px]="legendWidth"
1024
1056
  [horizontal]="legendOptions && legendOptions.position === LegendPosition.Below"
1025
1057
  [data]="legendOptions.domain"
1026
1058
  [title]="legendOptions.title"
@@ -1282,6 +1314,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
1282
1314
  args: [{
1283
1315
  selector: 'base-chart',
1284
1316
  template: ` <div></div> `,
1317
+ // eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection -- preserve pre-Angular-22 Default CD behavior
1285
1318
  changeDetection: ChangeDetectionStrategy.Eager,
1286
1319
  standalone: false
1287
1320
  }]
@@ -2067,13 +2100,19 @@ class YAxisTicksComponent {
2067
2100
  this.update();
2068
2101
  }
2069
2102
  ngAfterViewInit() {
2070
- setTimeout(() => this.updateDims());
2103
+ // Browser: measure after paint. SSR width is applied synchronously in update().
2104
+ if (isPlatformBrowser(this.platformId)) {
2105
+ setTimeout(() => this.updateDims());
2106
+ }
2071
2107
  }
2072
2108
  updateDims() {
2073
2109
  if (!isPlatformBrowser(this.platformId)) {
2074
- // for SSR, use approximate value instead of measured
2075
- this.width = this.getApproximateAxisWidth();
2076
- this.dimensionsChanged.emit({ width: this.width });
2110
+ // SSR: approximate — no DOM metrics available
2111
+ const width = this.getApproximateAxisWidth();
2112
+ if (width > 0 && width !== this.width) {
2113
+ this.width = width;
2114
+ this.dimensionsChanged.emit({ width: this.width });
2115
+ }
2077
2116
  return;
2078
2117
  }
2079
2118
  const width = parseInt(this.ticksElement.nativeElement.getBoundingClientRect().width, 10);
@@ -2162,7 +2201,13 @@ class YAxisTicksComponent {
2162
2201
  break;
2163
2202
  default:
2164
2203
  }
2165
- setTimeout(() => this.updateDims());
2204
+ // SSR must reserve axis width before HTML serialize (no deferred setTimeout).
2205
+ if (!isPlatformBrowser(this.platformId)) {
2206
+ this.updateDims();
2207
+ }
2208
+ else {
2209
+ setTimeout(() => this.updateDims());
2210
+ }
2166
2211
  }
2167
2212
  setReferencelines() {
2168
2213
  this.refMin = this.adjustedScale(Math.min.apply(null, this.referenceLines.map(item => item.value)));
@@ -2203,10 +2248,21 @@ class YAxisTicksComponent {
2203
2248
  tickTrim(label) {
2204
2249
  return this.trimTicks ? trimLabel(label, this.maxTickLength) : label;
2205
2250
  }
2251
+ /** Approx px width for SSR / pre-measure seeding. */
2252
+ static { this.APPROX_CHAR_WIDTH = 7; }
2253
+ static approximateTickLabelsWidth(labels, trimTicks = true, maxTickLength = 16) {
2254
+ if (!labels?.length) {
2255
+ return 0;
2256
+ }
2257
+ const maxChars = Math.max(0, ...labels.map(label => (trimTicks ? trimLabel(label, maxTickLength) : String(label)).length));
2258
+ return maxChars * YAxisTicksComponent.APPROX_CHAR_WIDTH;
2259
+ }
2206
2260
  getApproximateAxisWidth() {
2207
- const maxChars = Math.max(...this.ticks.map(t => this.tickTrim(this.tickFormat(t)).length));
2208
- const charWidth = 7;
2209
- return maxChars * charWidth;
2261
+ if (!this.ticks?.length || !this.tickFormat) {
2262
+ return 0;
2263
+ }
2264
+ const labels = this.ticks.map(t => this.tickTrim(this.tickFormat(t)));
2265
+ return YAxisTicksComponent.approximateTickLabelsWidth(labels, false, this.maxTickLength);
2210
2266
  }
2211
2267
  tickChunks(label) {
2212
2268
  if (label.toString().length > this.maxTickLength && this.scale.bandwidth) {
@@ -2431,6 +2487,8 @@ class YAxisComponent {
2431
2487
  this.tickStroke = '#CCC';
2432
2488
  this.strokeWidth = 1;
2433
2489
  this.padding = 5;
2490
+ /** Last tick-label width emitted to the parent chart (not conflated with labelOffset). */
2491
+ this.emittedTickWidth = null;
2434
2492
  }
2435
2493
  ngOnChanges(changes) {
2436
2494
  this.update();
@@ -2449,18 +2507,18 @@ class YAxisComponent {
2449
2507
  }
2450
2508
  }
2451
2509
  emitTicksWidth({ width }) {
2452
- if (width !== this.labelOffset && this.yOrient === Orientation.Right) {
2453
- this.labelOffset = width + this.labelOffset;
2454
- setTimeout(() => {
2455
- this.dimensionsChanged.emit({ width });
2456
- }, 0);
2510
+ if (width == null || width === this.emittedTickWidth) {
2511
+ return;
2457
2512
  }
2458
- else if (width !== this.labelOffset) {
2513
+ this.emittedTickWidth = width;
2514
+ if (this.yOrient === Orientation.Right) {
2515
+ this.labelOffset = width + 65;
2516
+ }
2517
+ else {
2459
2518
  this.labelOffset = width;
2460
- setTimeout(() => {
2461
- this.dimensionsChanged.emit({ width });
2462
- }, 0);
2463
2519
  }
2520
+ // Sync emit so SSR HTML serializes with reserved y-axis width (no setTimeout).
2521
+ this.dimensionsChanged.emit({ width });
2464
2522
  }
2465
2523
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: YAxisComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2466
2524
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: YAxisComponent, isStandalone: false, selector: "g[ngx-charts-y-axis]", inputs: { yScale: "yScale", dims: "dims", trimTicks: "trimTicks", maxTickLength: "maxTickLength", tickFormatting: "tickFormatting", ticks: "ticks", showGridLines: "showGridLines", showLabel: "showLabel", labelText: "labelText", yAxisTickCount: "yAxisTickCount", yOrient: "yOrient", referenceLines: "referenceLines", showRefLines: "showRefLines", showRefLabels: "showRefLabels", yAxisOffset: "yAxisOffset", wrapTicks: "wrapTicks" }, outputs: { dimensionsChanged: "dimensionsChanged" }, viewQueries: [{ propertyName: "ticksComponent", first: true, predicate: YAxisTicksComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: `
@@ -3775,6 +3833,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
3775
3833
  args: [{
3776
3834
  selector: '[ngx-charts-count-up]',
3777
3835
  template: ` {{ value }} `,
3836
+ // eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection -- preserve pre-Angular-22 Default CD behavior
3778
3837
  changeDetection: ChangeDetectionStrategy.Eager,
3779
3838
  standalone: false
3780
3839
  }]
@@ -7868,6 +7927,8 @@ class BarHorizontalComponent extends BaseChartComponent {
7868
7927
  this.dataLabelMaxWidth = { negative: 0, positive: 0 };
7869
7928
  }
7870
7929
  this.margin = [10, 20 + this.dataLabelMaxWidth.positive, 10, 20 + this.dataLabelMaxWidth.negative];
7930
+ // Seed axis width before first measure so SSR/print HTML reserves label space.
7931
+ this.seedYAxisWidthFromResults();
7871
7932
  this.dims = calculateViewDimensions({
7872
7933
  width: this.width,
7873
7934
  height: this.height,
@@ -7894,6 +7955,14 @@ class BarHorizontalComponent extends BaseChartComponent {
7894
7955
  refLines.forEach(line => parent.appendChild(line));
7895
7956
  }
7896
7957
  }
7958
+ /** Approx Y-axis width from category labels when not yet measured (SSR-safe). */
7959
+ seedYAxisWidthFromResults() {
7960
+ if (!this.yAxis || this.yAxisWidth > 0 || !this.results?.length) {
7961
+ return;
7962
+ }
7963
+ const labels = this.results.map(d => formatLabel(d.name ?? d.label));
7964
+ this.yAxisWidth = YAxisTicksComponent.approximateTickLabelsWidth(labels, this.trimYAxisTicks !== false, this.maxYAxisTickLength ?? 16);
7965
+ }
7897
7966
  getXScale() {
7898
7967
  this.xDomain = this.getXDomain();
7899
7968
  const scale = scaleLinear().range([0, this.dims.width]).domain(this.xDomain);
@@ -7946,10 +8015,16 @@ class BarHorizontalComponent extends BaseChartComponent {
7946
8015
  return opts;
7947
8016
  }
7948
8017
  updateYAxisWidth({ width }) {
8018
+ if (width === this.yAxisWidth) {
8019
+ return;
8020
+ }
7949
8021
  this.yAxisWidth = width;
7950
8022
  this.update();
7951
8023
  }
7952
8024
  updateXAxisHeight({ height }) {
8025
+ if (height === this.xAxisHeight) {
8026
+ return;
8027
+ }
7953
8028
  this.xAxisHeight = height;
7954
8029
  this.update();
7955
8030
  }