@swimlane/ngx-charts 25.0.2 → 25.0.4

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.2",
3
+ "version": "25.0.4",
4
4
  "description": "Declarative Charting Framework for Angular",
5
5
  "repository": {
6
6
  "type": "git",
@@ -714,6 +714,16 @@ declare enum TextAnchor {
714
714
  End = "end"
715
715
  }
716
716
 
717
+ interface XAxisTicksEstimateOptions {
718
+ scale: any;
719
+ width: number;
720
+ tickValues?: string[] | number[];
721
+ tickFormatting?: (value: any) => string;
722
+ trimTicks?: boolean;
723
+ rotateTicks?: boolean;
724
+ maxTickLength?: number;
725
+ wrapTicks?: boolean;
726
+ }
717
727
  declare class XAxisTicksComponent implements OnChanges, AfterViewInit {
718
728
  private platformId;
719
729
  scale: any;
@@ -747,6 +757,7 @@ declare class XAxisTicksComponent implements OnChanges, AfterViewInit {
747
757
  tickFormat: (o: any) => any;
748
758
  height: number;
749
759
  approxHeight: number;
760
+ ssrHeight: number;
750
761
  maxPossibleLengthForTickIfWrapped: number;
751
762
  transform: (o: any) => string;
752
763
  refMax: number;
@@ -765,7 +776,18 @@ declare class XAxisTicksComponent implements OnChanges, AfterViewInit {
765
776
  ngOnChanges(changes: SimpleChanges): void;
766
777
  ngAfterViewInit(): void;
767
778
  updateDims(): void;
779
+ /**
780
+ * Tick label height without DOM measurement. SSR serializes before the deferred `dimensionsChanged`
781
+ * emission is applied, so charts seed their x-axis height from this during `update()`.
782
+ */
783
+ static approximateTicksHeight(options: XAxisTicksEstimateOptions): number;
768
784
  update(): void;
785
+ private layout;
786
+ /**
787
+ * Estimated rendered height of the tick labels, matching what getBoundingClientRect reports in the
788
+ * browser: the rotated text run plus the projected glyph height, or the wrapped line stack.
789
+ */
790
+ getSsrHeight(angle: number | null): number;
769
791
  setReferencelines(): void;
770
792
  getRotationAngle(ticks: any[]): number;
771
793
  getTicks(): any[];
@@ -818,6 +840,15 @@ declare class XAxisComponent implements OnChanges {
818
840
  static ɵcmp: i0.ɵɵComponentDeclaration<XAxisComponent, "g[ngx-charts-x-axis]", never, { "xScale": { "alias": "xScale"; "required": false; }; "dims": { "alias": "dims"; "required": false; }; "trimTicks": { "alias": "trimTicks"; "required": false; }; "rotateTicks": { "alias": "rotateTicks"; "required": false; }; "maxTickLength": { "alias": "maxTickLength"; "required": false; }; "tickFormatting": { "alias": "tickFormatting"; "required": false; }; "showGridLines": { "alias": "showGridLines"; "required": false; }; "showLabel": { "alias": "showLabel"; "required": false; }; "labelText": { "alias": "labelText"; "required": false; }; "ticks": { "alias": "ticks"; "required": false; }; "xAxisTickCount": { "alias": "xAxisTickCount"; "required": false; }; "xOrient": { "alias": "xOrient"; "required": false; }; "referenceLines": { "alias": "referenceLines"; "required": false; }; "showRefLines": { "alias": "showRefLines"; "required": false; }; "showRefLabels": { "alias": "showRefLabels"; "required": false; }; "xAxisOffset": { "alias": "xAxisOffset"; "required": false; }; "wrapTicks": { "alias": "wrapTicks"; "required": false; }; }, { "dimensionsChanged": "dimensionsChanged"; }, never, never, false, never>;
819
841
  }
820
842
 
843
+ interface YAxisTicksEstimateOptions {
844
+ scale: any;
845
+ height: number;
846
+ tickValues?: string[] | number[];
847
+ tickFormatting?: (value: any) => string;
848
+ trimTicks?: boolean;
849
+ maxTickLength?: number;
850
+ wrapTicks?: boolean;
851
+ }
821
852
  declare class YAxisTicksComponent implements OnChanges, AfterViewInit {
822
853
  private platformId;
823
854
  scale: any;
@@ -884,6 +915,11 @@ declare class YAxisTicksComponent implements OnChanges, AfterViewInit {
884
915
  static readonly APPROX_CHAR_WIDTH = 6;
885
916
  static readonly TRIM_CHAR_WIDTH = 7;
886
917
  static effectiveMaxTickLength(yAxisWidth: number, maxTickLength: number, trimTicks?: boolean, label?: string): number;
918
+ /**
919
+ * Tick label width without DOM measurement. SSR serializes before the tick component's
920
+ * `dimensionsChanged` emission is applied, so charts seed their y-axis width from this during `update()`.
921
+ */
922
+ static approximateTicksWidth(options: YAxisTicksEstimateOptions): number;
887
923
  static approximateTickLabelsWidth(labels: string[], trimTicks?: boolean, maxTickLength?: number, wrapTicks?: boolean): number;
888
924
  static resolveAxisLayout(labels: string[], trimTicks?: boolean, maxTickLength?: number, wrapTicks?: boolean): {
889
925
  yAxisWidth: number;
@@ -1219,6 +1255,10 @@ declare class AreaChartComponent extends BaseChartComponent {
1219
1255
  updateYAxisWidth({ width }: {
1220
1256
  width: number;
1221
1257
  }): void;
1258
+ /** SSR serializes before the y-axis tick width emission lands, so reserve its width up front. */
1259
+ private seedYAxisWidthForSsr;
1260
+ /** SSR serializes before the deferred x-axis tick measurement lands, so reserve its height up front. */
1261
+ private seedXAxisHeightForSsr;
1222
1262
  updateXAxisHeight({ height }: {
1223
1263
  height: number;
1224
1264
  }): void;
@@ -1304,6 +1344,10 @@ declare class AreaChartNormalizedComponent extends BaseChartComponent {
1304
1344
  updateYAxisWidth({ width }: {
1305
1345
  width: number;
1306
1346
  }): void;
1347
+ /** SSR serializes before the y-axis tick width emission lands, so reserve its width up front. */
1348
+ private seedYAxisWidthForSsr;
1349
+ /** SSR serializes before the deferred x-axis tick measurement lands, so reserve its height up front. */
1350
+ private seedXAxisHeightForSsr;
1307
1351
  updateXAxisHeight({ height }: {
1308
1352
  height: number;
1309
1353
  }): void;
@@ -1393,6 +1437,10 @@ declare class AreaChartStackedComponent extends BaseChartComponent {
1393
1437
  updateYAxisWidth({ width }: {
1394
1438
  width: number;
1395
1439
  }): void;
1440
+ /** SSR serializes before the y-axis tick width emission lands, so reserve its width up front. */
1441
+ private seedYAxisWidthForSsr;
1442
+ /** SSR serializes before the deferred x-axis tick measurement lands, so reserve its height up front. */
1443
+ private seedXAxisHeightForSsr;
1396
1444
  updateXAxisHeight({ height }: {
1397
1445
  height: number;
1398
1446
  }): void;
@@ -3972,4 +4020,4 @@ declare function shadeRGBColor({ r, g, b }: {
3972
4020
  }, percent: number): string;
3973
4021
 
3974
4022
  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 };
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 };
4023
+ 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, XAxisTicksEstimateOptions, YAxisTicksEstimateOptions };