@acorex/charts 21.0.1-next.82 → 21.0.1-next.84

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.
@@ -10,6 +10,7 @@ interface AXFunnelData {
10
10
  id?: string | number;
11
11
  name: string;
12
12
  value: number;
13
+ /** Any CSS `<color>` resolvable in the chart container, e.g. `rgb(var(--ax-sys-color-primary-950))`. */
13
14
  color?: string;
14
15
  }
15
16
  interface AXFunnelChartMessages {
@@ -17,6 +18,10 @@ interface AXFunnelChartMessages {
17
18
  noDataIcon?: string;
18
19
  }
19
20
  interface AXFunnelChartOption {
21
+ /**
22
+ * Inset in SVG user units (fixed `viewBox` side length 400). The chart scales to its CSS box;
23
+ * margins keep the same proportions at any container size.
24
+ */
20
25
  margin?: {
21
26
  top: number;
22
27
  right: number;
@@ -28,12 +33,29 @@ interface AXFunnelChartOption {
28
33
  /** The ratio of the bottom width compared to the top width for the last segment (0 to 1). Default: 0.3 */
29
34
  neckWidth?: number;
30
35
  colors?: string[];
31
- /** Color used for the minimum value when `colors` is not provided. */
32
- startColor?: string;
33
- /** Color used for the maximum value when `colors` is not provided. */
34
- endColor?: string;
36
+ /**
37
+ * Base color when `colors` is not provided: any CSS `<color>` (hex, `rgb()`, `hsl()`,
38
+ * `rgb(var(--token))`, `color-mix()`, …) resolved against the chart container’s cascade.
39
+ * Intensity follows the value position in `valueRange` (or data min–max if `valueRange` is omitted).
40
+ */
41
+ color?: string;
42
+ /**
43
+ * Inclusive numeric range used to map values to color intensity (0–100% of the base color).
44
+ * If `valueRange` is omitted, or a bound is missing, that bound uses the dataset’s min or max
45
+ * value (after sorting: largest slice → max, smallest → min).
46
+ */
47
+ valueRange?: {
48
+ min: number;
49
+ max: number;
50
+ };
35
51
  showLabels?: boolean;
36
- /** Label offset from the slice edge (px). */
52
+ /**
53
+ * When `showLabels` is true, also render the numeric value on each segment.
54
+ * Values still appear in the tooltip when `showTooltip` is enabled.
55
+ * @default true
56
+ */
57
+ showSegmentValues?: boolean;
58
+ /** @deprecated Labels render inside segments; offset is unused. */
37
59
  labelOffset?: number;
38
60
  showTooltip?: boolean;
39
61
  animationDuration?: number;
@@ -42,6 +64,11 @@ interface AXFunnelChartOption {
42
64
  }
43
65
 
44
66
  declare class AXFunnelChartComponent extends AXChartComponent implements OnDestroy, AXChartComponentBase {
67
+ /**
68
+ * Fixed SVG coordinate system; the graphic scales to the container via `width`/`height: 100%` + `viewBox`.
69
+ * Margins and geometry are expressed in these units (same numeric scale as a ~400px reference viewport).
70
+ */
71
+ private static readonly VIEW_BOX_SIZE;
45
72
  data: _angular_core.InputSignal<AXFunnelData[]>;
46
73
  options: _angular_core.InputSignal<AXFunnelChartOption>;
47
74
  /** Emitted when a funnel segment is clicked */
@@ -51,9 +78,6 @@ declare class AXFunnelChartComponent extends AXChartComponent implements OnDestr
51
78
  protected d3: typeof d3;
52
79
  private _initialized;
53
80
  private _rendered;
54
- private platformService;
55
- protected isRtl: _angular_core.WritableSignal<boolean>;
56
- private directionSub?;
57
81
  private _tooltipVisible;
58
82
  private _tooltipPosition;
59
83
  private _tooltipData;
@@ -76,9 +100,13 @@ declare class AXFunnelChartComponent extends AXChartComponent implements OnDestr
76
100
  height?: number;
77
101
  neckWidth?: number;
78
102
  colors?: string[];
79
- startColor?: string;
80
- endColor?: string;
103
+ color?: string;
104
+ valueRange?: {
105
+ min: number;
106
+ max: number;
107
+ };
81
108
  showLabels?: boolean;
109
+ showSegmentValues?: boolean;
82
110
  labelOffset?: number;
83
111
  showTooltip?: boolean;
84
112
  animationDuration?: number;
@@ -89,7 +117,13 @@ declare class AXFunnelChartComponent extends AXChartComponent implements OnDestr
89
117
  ngOnDestroy(): void;
90
118
  protected loadD3(): Promise<void>;
91
119
  createChart(): void;
120
+ private trapezoidInteriorMetrics;
121
+ private computeSegmentLabelTypography;
122
+ private truncateLabel;
123
+ private pickOnSliceTextColors;
92
124
  private resolveSliceColor;
125
+ /** `resolvedRgb` must be a computed `rgb()` / `rgba()` string (e.g. from {@link resolveCssColor}). */
126
+ private applyIntensityToResolvedRgb;
93
127
  private hashStringToUint32;
94
128
  private resolveCssColor;
95
129
  updateChart(): void;
@@ -27,19 +27,33 @@ interface AXHeatmapChartOption {
27
27
  };
28
28
  /**
29
29
  * Discrete palette. If provided (non-empty), a (stable) random color is chosen per cell.
30
- * If omitted/empty, colors are computed from `startColor` `endColor` based on the cell value.
30
+ * Entries may use any CSS `<color>` (including `rgb(var(--token))`) resolved against the chart container.
31
+ * If omitted/empty, the base `color` is shown with intensity from the cell value vs `valueRange`
32
+ * (or data min–max if `valueRange` is omitted).
31
33
  */
32
34
  colors?: string[];
33
- /** Color used for the minimum value when `colors` is not provided. */
34
- startColor?: string;
35
- /** Color used for the maximum value when `colors` is not provided. */
36
- endColor?: string;
35
+ /**
36
+ * Base color when `colors` is not provided: any CSS `<color>` resolved against the chart container
37
+ * (hex, `rgb()`, `rgb(var(--token))`, `color-mix()`, …).
38
+ */
39
+ color?: string;
40
+ /**
41
+ * Inclusive numeric range for mapping cell values to color intensity.
42
+ * If `valueRange` is omitted, or a bound is missing, that bound uses the min or max value
43
+ * among all cells in the current dataset.
44
+ */
45
+ valueRange?: {
46
+ min: number;
47
+ max: number;
48
+ };
37
49
  cellPadding?: number;
38
50
  borderRadius?: number;
39
51
  showXAxis?: boolean;
40
52
  showYAxis?: boolean;
41
53
  xAxisLabel?: string;
42
54
  yAxisLabel?: string;
55
+ /** Like bar-chart: `true` / `false` forces rotation; `'auto'` picks −45° when labels would overflow each band step. */
56
+ rotateXAxisLabels?: boolean | 'auto';
43
57
  showTooltip?: boolean;
44
58
  animationDuration?: number;
45
59
  animationEasing?: AXAnimationEasing;
@@ -47,6 +61,18 @@ interface AXHeatmapChartOption {
47
61
  }
48
62
 
49
63
  declare class AXHeatmapChartComponent extends AXChartComponent implements OnDestroy {
64
+ /** Fixed `viewBox` side; chart scales with CSS `width` / `height` on the host container. */
65
+ private static readonly VIEW_BOX_SIZE;
66
+ private readonly CHAR_WIDTH_RATIO;
67
+ private readonly ROTATION_TOLERANCE_SMALL_DATASET;
68
+ private readonly SMALL_DATASET_THRESHOLD;
69
+ private readonly MANY_ITEMS_THRESHOLD;
70
+ private readonly VERY_MANY_ITEMS_THRESHOLD;
71
+ private readonly MAX_LABEL_LENGTH;
72
+ private readonly TICK_AREA_PADDING;
73
+ private readonly X_AXIS_TITLE_GAP;
74
+ private readonly MIN_FONT_SIZE_X_AXIS;
75
+ private readonly MAX_FONT_SIZE_X_AXIS;
50
76
  private readonly defaultConfig;
51
77
  data: _angular_core.InputSignal<AXHeatmapData[]>;
52
78
  options: _angular_core.InputSignal<AXHeatmapChartOption>;
@@ -76,14 +102,18 @@ declare class AXHeatmapChartComponent extends AXChartComponent implements OnDest
76
102
  left: number;
77
103
  };
78
104
  colors?: string[];
79
- startColor?: string;
80
- endColor?: string;
105
+ color?: string;
106
+ valueRange?: {
107
+ min: number;
108
+ max: number;
109
+ };
81
110
  cellPadding?: number;
82
111
  borderRadius?: number;
83
112
  showXAxis?: boolean;
84
113
  showYAxis?: boolean;
85
114
  xAxisLabel?: string;
86
115
  yAxisLabel?: string;
116
+ rotateXAxisLabels?: boolean | "auto";
87
117
  showTooltip?: boolean;
88
118
  animationDuration?: number;
89
119
  animationEasing?: _acorex_charts.AXAnimationEasing;
@@ -91,15 +121,22 @@ declare class AXHeatmapChartComponent extends AXChartComponent implements OnDest
91
121
  }>;
92
122
  constructor();
93
123
  private init;
124
+ updateChart(): void;
94
125
  private renderChart;
95
126
  private hashStringToUint32;
96
- private resolveCssColor;
127
+ /** `resolvedRgb` must be a computed `rgb()` / `rgba()` string (e.g. from {@link resolveCssColorInContext}). */
128
+ private applyIntensityToResolvedRgb;
97
129
  private drawAxis;
98
130
  private showTooltip;
99
131
  private updateTooltipPos;
100
132
  private hideTooltip;
101
133
  ngOnDestroy(): void;
102
134
  private drawAxisLabels;
135
+ private getHeatmapXTickFontSize;
136
+ private getHeatmapXTickPlan;
137
+ private truncateHeatmapLabel;
138
+ private shouldRotateHeatmapXLabels;
139
+ private styleHeatmapXAxisTicks;
103
140
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXHeatmapChartComponent, never>;
104
141
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<AXHeatmapChartComponent, "ax-heatmap-chart", never, { "data": { "alias": "data"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; }, { "cellClick": "cellClick"; }, never, never, true, never>;
105
142
  }
@@ -55,6 +55,13 @@ type TooltipPosition = {
55
55
  x: number;
56
56
  y: number;
57
57
  };
58
+ /**
59
+ * Resolves any CSS `<color>` the browser understands — including
60
+ * `rgb(var(--token))`, `hsl(var(--token))`, `color-mix()`, etc. — to a computed
61
+ * `rgb()` / `rgba()` string, using the cascade from `scopeElement` (e.g. the chart
62
+ * container) so design tokens on ancestors apply.
63
+ */
64
+ declare function resolveCssColorInContext(scopeElement: HTMLElement, cssColor: string): string;
58
65
  /**
59
66
  * Compute edge-aware tooltip position with intelligent placement,
60
67
  * considering available space in all directions and preventing overflow.
@@ -77,5 +84,5 @@ declare function getEasingFunction(d3: typeof d3, option?: string): (t: number)
77
84
 
78
85
  declare const AX_CHARTS = "ACOREX_CHARTS";
79
86
 
80
- export { AXChartComponent, AX_CHARTS, AX_CHART_COLOR_PALETTE, computeTooltipPosition, formatLargeNumber, getChartColor, getEasingFunction, mapEasingName };
87
+ export { AXChartComponent, AX_CHARTS, AX_CHART_COLOR_PALETTE, computeTooltipPosition, formatLargeNumber, getChartColor, getEasingFunction, mapEasingName, resolveCssColorInContext };
81
88
  export type { AXAnimationEasing, AXChartComponentBase, D3EasingName, NXNativeEvent, TooltipPosition };