@swimlane/ngx-charts 25.0.1 → 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.1",
3
+ "version": "25.0.2",
4
4
  "description": "Declarative Charting Framework for Angular",
5
5
  "repository": {
6
6
  "type": "git",
@@ -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,16 +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;
871
- /** Approx px width for SSR / pre-measure seeding. */
872
- static readonly APPROX_CHAR_WIDTH = 7;
873
- static approximateTickLabelsWidth(labels: string[], trimTicks?: boolean, maxTickLength?: number): number;
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;
874
894
  getApproximateAxisWidth(): number;
895
+ private getMeasuredAxisWidth;
875
896
  tickChunks(label: string): string[];
876
897
  static ɵfac: i0.ɵɵFactoryDeclaration<YAxisTicksComponent, never>;
877
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>;
@@ -1590,6 +1611,8 @@ declare class BarHorizontal2DComponent extends BaseChartComponent {
1590
1611
  ngOnInit(): void;
1591
1612
  ngOnChanges(): void;
1592
1613
  update(): void;
1614
+ /** Approx Y-axis width from category labels when not yet measured (SSR-safe). */
1615
+ seedYAxisWidthFromResults(): void;
1593
1616
  getGroupScale(): any;
1594
1617
  getInnerScale(): any;
1595
1618
  getValueScale(): any;
@@ -1667,6 +1690,8 @@ declare class BarHorizontalNormalizedComponent extends BaseChartComponent {
1667
1690
  isSSR: boolean;
1668
1691
  ngOnInit(): void;
1669
1692
  update(): void;
1693
+ /** Approx Y-axis width from category labels when not yet measured (SSR-safe). */
1694
+ seedYAxisWidthFromResults(): void;
1670
1695
  getGroupDomain(): string[];
1671
1696
  getInnerDomain(): string[];
1672
1697
  getYScale(): any;
@@ -1739,6 +1764,8 @@ declare class BarHorizontalStackedComponent extends BaseChartComponent {
1739
1764
  isSSR: boolean;
1740
1765
  ngOnInit(): void;
1741
1766
  update(): void;
1767
+ /** Approx Y-axis width from category labels when not yet measured (SSR-safe). */
1768
+ seedYAxisWidthFromResults(): void;
1742
1769
  getGroupDomain(): string[];
1743
1770
  getInnerDomain(): string[];
1744
1771
  getValueDomain(): [number, number];
@@ -2106,7 +2133,8 @@ interface Bar {
2106
2133
  y: number;
2107
2134
  }
2108
2135
 
2109
- declare class SeriesHorizontal implements OnChanges {
2136
+ declare class SeriesHorizontal implements OnChanges, OnInit {
2137
+ private platformId;
2110
2138
  dims: ViewDimensions;
2111
2139
  type: BarChartType;
2112
2140
  series: DataItem[];
@@ -2142,6 +2170,9 @@ declare class SeriesHorizontal implements OnChanges {
2142
2170
  series: string;
2143
2171
  }>;
2144
2172
  barOrientation: typeof BarOrientation;
2173
+ isSSR: boolean;
2174
+ constructor(platformId: any);
2175
+ ngOnInit(): void;
2145
2176
  ngOnChanges(): void;
2146
2177
  update(): void;
2147
2178
  updateDataLabels(): void;
@@ -2282,7 +2313,8 @@ declare class BoxChartComponent extends BaseChartComponent {
2282
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>;
2283
2314
  }
2284
2315
 
2285
- declare class BoxSeriesComponent implements OnChanges {
2316
+ declare class BoxSeriesComponent implements OnChanges, OnInit {
2317
+ private platformId;
2286
2318
  dims: ViewDimensions;
2287
2319
  series: BoxChartSeries;
2288
2320
  xScale: ScaleBand<string>;
@@ -2306,6 +2338,9 @@ declare class BoxSeriesComponent implements OnChanges {
2306
2338
  whiskers: [number, number];
2307
2339
  lineCoordinates: [IVector2D, IVector2D, IVector2D, IVector2D];
2308
2340
  tooltipTitle: string;
2341
+ isSSR: boolean;
2342
+ constructor(platformId: any);
2343
+ ngOnInit(): void;
2309
2344
  ngOnChanges(changes: SimpleChanges): void;
2310
2345
  onClick(data: IBoxModel): void;
2311
2346
  update(): void;
@@ -3824,6 +3859,8 @@ declare function decimalChecker(countTo: number): number;
3824
3859
 
3825
3860
  declare function tickFormat(fieldType: any, groupByType: any): (label: string) => string;
3826
3861
 
3862
+ /** Max whole characters that fit in a pixel width (SSR / axis layout). */
3863
+ declare function maxCharsForPixelWidth(maxWidthPx: number, charWidth?: number): number;
3827
3864
  declare function trimLabel(s: any, max?: number): string;
3828
3865
 
3829
3866
  declare function calculateViewDimensions({ width, height, margins, showXAxis, showYAxis, xAxisHeight, yAxisWidth, showXLabel, showYLabel, showLegend, legendType, legendPosition, columns }: {
@@ -3934,5 +3971,5 @@ declare function shadeRGBColor({ r, g, b }: {
3934
3971
  b: any;
3935
3972
  }, percent: number): string;
3936
3973
 
3937
- 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 };
3938
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 };