@swimlane/ngx-charts 25.0.0 → 25.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swimlane/ngx-charts",
3
- "version": "25.0.0",
3
+ "version": "25.0.2",
4
4
  "description": "Declarative Charting Framework for Angular",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,13 +30,13 @@
30
30
  },
31
31
  "homepage": "https://github.com/swimlane/ngx-charts#readme",
32
32
  "peerDependencies": {
33
- "@angular/animations": "19.x || 20.x || 21.x || 22.x",
34
- "@angular/cdk": "19.x || 20.x || 21.x || 22.x",
35
- "@angular/core": "19.x || 20.x || 21.x || 22.x",
36
- "@angular/common": "19.x || 20.x || 21.x || 22.x",
37
- "@angular/forms": "19.x || 20.x || 21.x || 22.x",
38
- "@angular/platform-browser": "19.x || 20.x || 21.x || 22.x",
39
- "@angular/platform-browser-dynamic": "19.x || 20.x || 21.x || 22.x",
33
+ "@angular/animations": "^21.2.0 || ^22.0.0",
34
+ "@angular/cdk": "^21.2.0 || ^22.0.0",
35
+ "@angular/core": "^21.2.0 || ^22.0.0",
36
+ "@angular/common": "^21.2.0 || ^22.0.0",
37
+ "@angular/forms": "^21.2.0 || ^22.0.0",
38
+ "@angular/platform-browser": "^21.2.0 || ^22.0.0",
39
+ "@angular/platform-browser-dynamic": "^21.2.0 || ^22.0.0",
40
40
  "rxjs": "7.x"
41
41
  },
42
42
  "dependencies": {
@@ -300,7 +300,7 @@ interface Tooltip {
300
300
  series: any;
301
301
  value: any;
302
302
  }
303
- declare class TooltipArea {
303
+ declare class TooltipArea implements OnInit {
304
304
  private platformId;
305
305
  anchorOpacity: number;
306
306
  anchorPos: number;
@@ -321,7 +321,9 @@ declare class TooltipArea {
321
321
  value: any;
322
322
  }>;
323
323
  tooltipAnchor: any;
324
+ isSSR: boolean;
324
325
  constructor(platformId: any);
326
+ ngOnInit(): void;
325
327
  getValues(xVal: any): Tooltip[];
326
328
  mouseMove(event: any): void;
327
329
  findClosestPointIndex(xPos: number): number;
@@ -855,6 +857,9 @@ declare class YAxisTicksComponent implements OnChanges, AfterViewInit {
855
857
  refMin: number;
856
858
  referenceLineLength: number;
857
859
  referenceAreaPath: string;
860
+ /** Stable axis width for truncation/wrapping; never updated from DOM measurement. */
861
+ private layoutAxisWidth;
862
+ private lastEmittedWidth;
858
863
  readonly Orientation: typeof Orientation;
859
864
  ticksElement: ElementRef;
860
865
  constructor(platformId: any);
@@ -862,13 +867,32 @@ declare class YAxisTicksComponent implements OnChanges, AfterViewInit {
862
867
  ngAfterViewInit(): void;
863
868
  updateDims(): void;
864
869
  update(): void;
870
+ private resolveLayoutAxisWidth;
871
+ private applySsrAxisLayout;
865
872
  setReferencelines(): void;
866
873
  getTicks(): any[];
867
874
  getMaxTicks(tickHeight: number): number;
868
875
  tickTransform(tick: number): string;
869
876
  gridLineTransform(): string;
870
877
  tickTrim(label: string): string;
878
+ private getEffectiveMaxTickLength;
879
+ static readonly Y_AXIS_PADDING = 5;
880
+ static readonly VIEW_DIMS_Y_AXIS_SPACER = 10;
881
+ static readonly INNER_TICK_SIZE = 6;
882
+ static readonly TICK_PADDING = 3;
883
+ static readonly AXIS_LAYOUT_INSET: number;
884
+ static readonly APPROX_CHAR_WIDTH = 6;
885
+ static readonly TRIM_CHAR_WIDTH = 7;
886
+ static effectiveMaxTickLength(yAxisWidth: number, maxTickLength: number, trimTicks?: boolean, label?: string): number;
887
+ static approximateTickLabelsWidth(labels: string[], trimTicks?: boolean, maxTickLength?: number, wrapTicks?: boolean): number;
888
+ static resolveAxisLayout(labels: string[], trimTicks?: boolean, maxTickLength?: number, wrapTicks?: boolean): {
889
+ yAxisWidth: number;
890
+ maxTickLength: number;
891
+ };
892
+ static requiredYAxisWidth(textWidth: number): number;
893
+ static labelLeftFromLayout(marginsLeft: number, yAxisWidth: number, textWidth: number): number;
871
894
  getApproximateAxisWidth(): number;
895
+ private getMeasuredAxisWidth;
872
896
  tickChunks(label: string): string[];
873
897
  static ɵfac: i0.ɵɵFactoryDeclaration<YAxisTicksComponent, never>;
874
898
  static ɵcmp: i0.ɵɵComponentDeclaration<YAxisTicksComponent, "g[ngx-charts-y-axis-ticks]", never, { "scale": { "alias": "scale"; "required": false; }; "orient": { "alias": "orient"; "required": false; }; "tickArguments": { "alias": "tickArguments"; "required": false; }; "tickValues": { "alias": "tickValues"; "required": false; }; "tickStroke": { "alias": "tickStroke"; "required": false; }; "trimTicks": { "alias": "trimTicks"; "required": false; }; "maxTickLength": { "alias": "maxTickLength"; "required": false; }; "tickFormatting": { "alias": "tickFormatting"; "required": false; }; "showGridLines": { "alias": "showGridLines"; "required": false; }; "gridLineWidth": { "alias": "gridLineWidth"; "required": false; }; "height": { "alias": "height"; "required": false; }; "referenceLines": { "alias": "referenceLines"; "required": false; }; "showRefLabels": { "alias": "showRefLabels"; "required": false; }; "showRefLines": { "alias": "showRefLines"; "required": false; }; "wrapTicks": { "alias": "wrapTicks"; "required": false; }; }, { "dimensionsChanged": "dimensionsChanged"; }, never, never, false, never>;
@@ -902,6 +926,8 @@ declare class YAxisComponent implements OnChanges {
902
926
  tickStroke: string;
903
927
  strokeWidth: number;
904
928
  padding: number;
929
+ /** Last tick-label width emitted to the parent chart (not conflated with labelOffset). */
930
+ private emittedTickWidth;
905
931
  ticksComponent: YAxisTicksComponent;
906
932
  ngOnChanges(changes: SimpleChanges): void;
907
933
  update(): void;
@@ -1508,6 +1534,8 @@ declare class BarHorizontalComponent extends BaseChartComponent {
1508
1534
  dataLabelMaxWidth: any;
1509
1535
  ngOnChanges(): void;
1510
1536
  update(): void;
1537
+ /** Approx Y-axis width from category labels when not yet measured (SSR-safe). */
1538
+ seedYAxisWidthFromResults(): void;
1511
1539
  getXScale(): any;
1512
1540
  getYScale(): any;
1513
1541
  getXDomain(): [number, number];
@@ -1583,6 +1611,8 @@ declare class BarHorizontal2DComponent extends BaseChartComponent {
1583
1611
  ngOnInit(): void;
1584
1612
  ngOnChanges(): void;
1585
1613
  update(): void;
1614
+ /** Approx Y-axis width from category labels when not yet measured (SSR-safe). */
1615
+ seedYAxisWidthFromResults(): void;
1586
1616
  getGroupScale(): any;
1587
1617
  getInnerScale(): any;
1588
1618
  getValueScale(): any;
@@ -1660,6 +1690,8 @@ declare class BarHorizontalNormalizedComponent extends BaseChartComponent {
1660
1690
  isSSR: boolean;
1661
1691
  ngOnInit(): void;
1662
1692
  update(): void;
1693
+ /** Approx Y-axis width from category labels when not yet measured (SSR-safe). */
1694
+ seedYAxisWidthFromResults(): void;
1663
1695
  getGroupDomain(): string[];
1664
1696
  getInnerDomain(): string[];
1665
1697
  getYScale(): any;
@@ -1732,6 +1764,8 @@ declare class BarHorizontalStackedComponent extends BaseChartComponent {
1732
1764
  isSSR: boolean;
1733
1765
  ngOnInit(): void;
1734
1766
  update(): void;
1767
+ /** Approx Y-axis width from category labels when not yet measured (SSR-safe). */
1768
+ seedYAxisWidthFromResults(): void;
1735
1769
  getGroupDomain(): string[];
1736
1770
  getInnerDomain(): string[];
1737
1771
  getValueDomain(): [number, number];
@@ -2099,7 +2133,8 @@ interface Bar {
2099
2133
  y: number;
2100
2134
  }
2101
2135
 
2102
- declare class SeriesHorizontal implements OnChanges {
2136
+ declare class SeriesHorizontal implements OnChanges, OnInit {
2137
+ private platformId;
2103
2138
  dims: ViewDimensions;
2104
2139
  type: BarChartType;
2105
2140
  series: DataItem[];
@@ -2135,6 +2170,9 @@ declare class SeriesHorizontal implements OnChanges {
2135
2170
  series: string;
2136
2171
  }>;
2137
2172
  barOrientation: typeof BarOrientation;
2173
+ isSSR: boolean;
2174
+ constructor(platformId: any);
2175
+ ngOnInit(): void;
2138
2176
  ngOnChanges(): void;
2139
2177
  update(): void;
2140
2178
  updateDataLabels(): void;
@@ -2275,7 +2313,8 @@ declare class BoxChartComponent extends BaseChartComponent {
2275
2313
  static ɵcmp: i0.ɵɵComponentDeclaration<BoxChartComponent, "ngx-charts-box-chart", never, { "legend": { "alias": "legend"; "required": false; }; "legendPosition": { "alias": "legendPosition"; "required": false; }; "legendTitle": { "alias": "legendTitle"; "required": false; }; "legendOptionsConfig": { "alias": "legendOptionsConfig"; "required": false; }; "showGridLines": { "alias": "showGridLines"; "required": false; }; "xAxis": { "alias": "xAxis"; "required": false; }; "yAxis": { "alias": "yAxis"; "required": false; }; "showXAxisLabel": { "alias": "showXAxisLabel"; "required": false; }; "showYAxisLabel": { "alias": "showYAxisLabel"; "required": false; }; "roundDomains": { "alias": "roundDomains"; "required": false; }; "xAxisLabel": { "alias": "xAxisLabel"; "required": false; }; "yAxisLabel": { "alias": "yAxisLabel"; "required": false; }; "roundEdges": { "alias": "roundEdges"; "required": false; }; "strokeColor": { "alias": "strokeColor"; "required": false; }; "strokeWidth": { "alias": "strokeWidth"; "required": false; }; "tooltipDisabled": { "alias": "tooltipDisabled"; "required": false; }; "gradient": { "alias": "gradient"; "required": false; }; "wrapTicks": { "alias": "wrapTicks"; "required": false; }; }, { "select": "select"; "activate": "activate"; "deactivate": "deactivate"; }, ["tooltipTemplate"], never, false, never>;
2276
2314
  }
2277
2315
 
2278
- declare class BoxSeriesComponent implements OnChanges {
2316
+ declare class BoxSeriesComponent implements OnChanges, OnInit {
2317
+ private platformId;
2279
2318
  dims: ViewDimensions;
2280
2319
  series: BoxChartSeries;
2281
2320
  xScale: ScaleBand<string>;
@@ -2299,6 +2338,9 @@ declare class BoxSeriesComponent implements OnChanges {
2299
2338
  whiskers: [number, number];
2300
2339
  lineCoordinates: [IVector2D, IVector2D, IVector2D, IVector2D];
2301
2340
  tooltipTitle: string;
2341
+ isSSR: boolean;
2342
+ constructor(platformId: any);
2343
+ ngOnInit(): void;
2302
2344
  ngOnChanges(changes: SimpleChanges): void;
2303
2345
  onClick(data: IBoxModel): void;
2304
2346
  update(): void;
@@ -3817,6 +3859,8 @@ declare function decimalChecker(countTo: number): number;
3817
3859
 
3818
3860
  declare function tickFormat(fieldType: any, groupByType: any): (label: string) => string;
3819
3861
 
3862
+ /** Max whole characters that fit in a pixel width (SSR / axis layout). */
3863
+ declare function maxCharsForPixelWidth(maxWidthPx: number, charWidth?: number): number;
3820
3864
  declare function trimLabel(s: any, max?: number): string;
3821
3865
 
3822
3866
  declare function calculateViewDimensions({ width, height, margins, showXAxis, showYAxis, xAxisHeight, yAxisWidth, showXLabel, showYLabel, showLegend, legendType, legendPosition, columns }: {
@@ -3927,5 +3971,5 @@ declare function shadeRGBColor({ r, g, b }: {
3927
3971
  b: any;
3928
3972
  }, percent: number): string;
3929
3973
 
3930
- export { AdvancedLegendComponent, AdvancedPieChartComponent, AreaChartComponent, AreaChartModule, AreaChartNormalizedComponent, AreaChartStackedComponent, AreaComponent, AreaSeriesComponent, AxesModule, AxisLabelComponent, BarChartModule, BarChartType, BarComponent, BarHorizontal2DComponent, BarHorizontalComponent, BarHorizontalNormalizedComponent, BarHorizontalStackedComponent, BarLabelComponent, BarOrientation, BarVertical2DComponent, BarVerticalComponent, BarVerticalNormalizedComponent, BarVerticalStackedComponent, BaseChartComponent, BoxChartComponent, BoxChartModule, BoxComponent, BoxSeriesComponent, BubbleChartComponent, BubbleChartModule, BubbleSeriesComponent, CardComponent, CardSeriesComponent, ChartCommonModule, ChartComponent, CircleComponent, CircleSeriesComponent, ColorHelper, CountUpDirective, D0Types, GaugeArcComponent, GaugeAxisComponent, GaugeComponent, GaugeModule, GridPanelComponent, GridPanelSeriesComponent, HeatCellSeriesComponent, HeatMapCellComponent, HeatMapComponent, HeatMapModule, LegendComponent, LegendEntryComponent, LegendPosition, LegendType, LineChartComponent, LineChartModule, LineComponent, LineSeriesComponent, LinearGaugeComponent, NgxChartsModule, NumberCardComponent, NumberCardModule, Orientation, PercentGaugeComponent, PieArcComponent, PieChartComponent, PieChartModule, PieGridComponent, PieGridSeriesComponent, PieLabelComponent, PieSeriesComponent, PlacementTypes, PolarChartComponent, PolarChartModule, PolarSeriesComponent, SankeyComponent, SankeyModule, ScaleLegendComponent, ScaleType, SeriesHorizontal, SeriesType, SeriesVerticalComponent, ShowTypes, StyleTypes, SvgLinearGradientComponent, SvgRadialGradientComponent, TextAnchor, Timeline, TooltipArea, TooltipContentComponent, TooltipDirective, TooltipModule, TooltipService, TreeMapCellComponent, TreeMapCellSeriesComponent, TreeMapComponent, TreeMapModule, VisibilityObserver, XAxisComponent, XAxisTicksComponent, YAxisComponent, YAxisTicksComponent, calculateViewDimensions, cloneLineCoordinates, clonePoint, cloneVector2d, colorSets, count, decimalChecker, escapeLabel, formatLabel, getDomain, getScale, getScaleType, getTickLines, getUniqueXDomainValues, getXDomainArray, gridLayout, gridSize, hexToRgb, id, invertColor, reduceTicks, shadeRGBColor, sortByDomain, sortByTime, sortLinear, throttle, throttleable, tickFormat, trimLabel };
3974
+ export { AdvancedLegendComponent, AdvancedPieChartComponent, AreaChartComponent, AreaChartModule, AreaChartNormalizedComponent, AreaChartStackedComponent, AreaComponent, AreaSeriesComponent, AxesModule, AxisLabelComponent, BarChartModule, BarChartType, BarComponent, BarHorizontal2DComponent, BarHorizontalComponent, BarHorizontalNormalizedComponent, BarHorizontalStackedComponent, BarLabelComponent, BarOrientation, BarVertical2DComponent, BarVerticalComponent, BarVerticalNormalizedComponent, BarVerticalStackedComponent, BaseChartComponent, BoxChartComponent, BoxChartModule, BoxComponent, BoxSeriesComponent, BubbleChartComponent, BubbleChartModule, BubbleSeriesComponent, CardComponent, CardSeriesComponent, ChartCommonModule, ChartComponent, CircleComponent, CircleSeriesComponent, ColorHelper, CountUpDirective, D0Types, GaugeArcComponent, GaugeAxisComponent, GaugeComponent, GaugeModule, GridPanelComponent, GridPanelSeriesComponent, HeatCellSeriesComponent, HeatMapCellComponent, HeatMapComponent, HeatMapModule, LegendComponent, LegendEntryComponent, LegendPosition, LegendType, LineChartComponent, LineChartModule, LineComponent, LineSeriesComponent, LinearGaugeComponent, NgxChartsModule, NumberCardComponent, NumberCardModule, Orientation, PercentGaugeComponent, PieArcComponent, PieChartComponent, PieChartModule, PieGridComponent, PieGridSeriesComponent, PieLabelComponent, PieSeriesComponent, PlacementTypes, PolarChartComponent, PolarChartModule, PolarSeriesComponent, SankeyComponent, SankeyModule, ScaleLegendComponent, ScaleType, SeriesHorizontal, SeriesType, SeriesVerticalComponent, ShowTypes, StyleTypes, SvgLinearGradientComponent, SvgRadialGradientComponent, TextAnchor, Timeline, TooltipArea, TooltipContentComponent, TooltipDirective, TooltipModule, TooltipService, TreeMapCellComponent, TreeMapCellSeriesComponent, TreeMapComponent, TreeMapModule, VisibilityObserver, XAxisComponent, XAxisTicksComponent, YAxisComponent, YAxisTicksComponent, calculateViewDimensions, cloneLineCoordinates, clonePoint, cloneVector2d, colorSets, count, decimalChecker, escapeLabel, formatLabel, getDomain, getScale, getScaleType, getTickLines, getUniqueXDomainValues, getXDomainArray, gridLayout, gridSize, hexToRgb, id, invertColor, maxCharsForPixelWidth, reduceTicks, shadeRGBColor, sortByDomain, sortByTime, sortLinear, throttle, throttleable, tickFormat, trimLabel };
3931
3975
  export type { AdvancedLegendItem, ArcItem, AreaChartDataItem, AreaChartSeries, Bar, BoxChartMultiSeries, BoxChartSeries, BubbleChartDataItem, BubbleChartMultiSeries, BubbleChartSeries, CardModel, Circle, Color, DataItem, Gradient, GridData, GridItem, IBoxModel, LegendEntry, LegendOptions, MultiSeries, PieArc, PieData, PieGridData, PieGridDataItem, SankeyData, SankeyObject, Series, SingleSeries, StringOrNumberOrDate, Tooltip, TreeMapData, TreeMapDataItem, ViewDimensions };