@acorex/charts 19.13.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.
Files changed (46) hide show
  1. package/README.md +72 -0
  2. package/bar-chart/README.md +3 -0
  3. package/bar-chart/index.d.ts +3 -0
  4. package/bar-chart/lib/bar-chart.component.d.ts +123 -0
  5. package/bar-chart/lib/bar-chart.config.d.ts +6 -0
  6. package/bar-chart/lib/bar-chart.type.d.ts +44 -0
  7. package/chart-tooltip/README.md +3 -0
  8. package/chart-tooltip/index.d.ts +2 -0
  9. package/chart-tooltip/lib/chart-tooltip.component.d.ts +43 -0
  10. package/chart-tooltip/lib/chart-tooltip.type.d.ts +7 -0
  11. package/donut-chart/README.md +3 -0
  12. package/donut-chart/index.d.ts +3 -0
  13. package/donut-chart/lib/donut-chart.component.d.ts +143 -0
  14. package/donut-chart/lib/donut-chart.config.d.ts +6 -0
  15. package/donut-chart/lib/donut-chart.type.d.ts +25 -0
  16. package/fesm2022/acorex-charts-bar-chart.mjs +563 -0
  17. package/fesm2022/acorex-charts-bar-chart.mjs.map +1 -0
  18. package/fesm2022/acorex-charts-chart-tooltip.mjs +75 -0
  19. package/fesm2022/acorex-charts-chart-tooltip.mjs.map +1 -0
  20. package/fesm2022/acorex-charts-donut-chart.mjs +616 -0
  21. package/fesm2022/acorex-charts-donut-chart.mjs.map +1 -0
  22. package/fesm2022/acorex-charts-gauge-chart.mjs +548 -0
  23. package/fesm2022/acorex-charts-gauge-chart.mjs.map +1 -0
  24. package/fesm2022/acorex-charts-hierarchy-chart.mjs +652 -0
  25. package/fesm2022/acorex-charts-hierarchy-chart.mjs.map +1 -0
  26. package/fesm2022/acorex-charts-line-chart.mjs +738 -0
  27. package/fesm2022/acorex-charts-line-chart.mjs.map +1 -0
  28. package/fesm2022/acorex-charts.mjs +8 -0
  29. package/fesm2022/acorex-charts.mjs.map +1 -0
  30. package/gauge-chart/README.md +3 -0
  31. package/gauge-chart/index.d.ts +3 -0
  32. package/gauge-chart/lib/gauge-chart.component.d.ts +110 -0
  33. package/gauge-chart/lib/gauge-chart.config.d.ts +6 -0
  34. package/gauge-chart/lib/gauge-chart.type.d.ts +37 -0
  35. package/hierarchy-chart/README.md +61 -0
  36. package/hierarchy-chart/index.d.ts +3 -0
  37. package/hierarchy-chart/lib/hierarchy-chart.component.d.ts +99 -0
  38. package/hierarchy-chart/lib/hierarchy-chart.config.d.ts +6 -0
  39. package/hierarchy-chart/lib/hierarchy-chart.type.d.ts +227 -0
  40. package/index.d.ts +1 -0
  41. package/line-chart/README.md +3 -0
  42. package/line-chart/index.d.ts +3 -0
  43. package/line-chart/lib/line-chart.component.d.ts +96 -0
  44. package/line-chart/lib/line-chart.config.d.ts +6 -0
  45. package/line-chart/lib/line-chart.type.d.ts +61 -0
  46. package/package.json +48 -0
@@ -0,0 +1,563 @@
1
+ import { AXChartTooltipComponent } from '@acorex/charts/chart-tooltip';
2
+ import { CommonModule } from '@angular/common';
3
+ import * as i0 from '@angular/core';
4
+ import { InjectionToken, inject, input, output, viewChild, signal, computed, afterNextRender, effect, ChangeDetectionStrategy, Component } from '@angular/core';
5
+ import { AX_GLOBAL_CONFIG } from '@acorex/core/config';
6
+ import { set } from 'lodash-es';
7
+
8
+ const AXBarChartDefaultConfig = {
9
+ margin: {
10
+ top: 20,
11
+ right: 20,
12
+ bottom: 30,
13
+ left: 40,
14
+ },
15
+ showXAxis: true,
16
+ showYAxis: true,
17
+ showGrid: true,
18
+ showTooltip: true,
19
+ barWidth: 80,
20
+ cornerRadius: 4,
21
+ animationDuration: 800,
22
+ animationEasing: 'cubic-out',
23
+ };
24
+ const AX_BAR_CHART_CONFIG = new InjectionToken('AX_BAR_CHART_CONFIG', {
25
+ providedIn: 'root',
26
+ factory: () => {
27
+ const global = inject(AX_GLOBAL_CONFIG);
28
+ set(global, 'chart.barChart', AXBarChartDefaultConfig);
29
+ return AXBarChartDefaultConfig;
30
+ },
31
+ });
32
+ function barChartConfig(config = {}) {
33
+ const result = {
34
+ ...AXBarChartDefaultConfig,
35
+ ...config,
36
+ };
37
+ return result;
38
+ }
39
+
40
+ const AXBarChartColors = {
41
+ // Modern color palette suitable for data visualization
42
+ defaultColors: [
43
+ '#4361ee', // Blue
44
+ '#3a0ca3', // Purple
45
+ '#7209b7', // Violet
46
+ '#f72585', // Pink
47
+ '#4cc9f0', // Light Blue
48
+ '#4895ef', // Sky Blue
49
+ '#560bad', // Deep Purple
50
+ '#f15bb5', // Light Pink
51
+ '#00bbf9', // Cyan
52
+ '#00f5d4', // Teal
53
+ ],
54
+ // Get a color from the palette by index with wraparound
55
+ getColor: (index, customPalette) => {
56
+ const palette = customPalette || AXBarChartColors.defaultColors;
57
+ return palette[index % palette.length];
58
+ },
59
+ };
60
+ /**
61
+ * Bar Chart Component
62
+ * Renders data as vertical bars with interactive hover effects and animations
63
+ */
64
+ class AXBarChartComponent {
65
+ // Inputs
66
+ /** Chart data input */
67
+ data = input([]);
68
+ /** Chart options input */
69
+ options = input({});
70
+ // Outputs
71
+ /** Emitted when a bar is clicked */
72
+ barClick = output();
73
+ // Chart container reference
74
+ chartContainerEl = viewChild.required('chartContainer');
75
+ // D3 reference - loaded asynchronously
76
+ d3;
77
+ // Chart elements
78
+ svg;
79
+ chart;
80
+ xScale;
81
+ yScale;
82
+ xAxis;
83
+ yAxis;
84
+ // Chart dimensions
85
+ width;
86
+ height;
87
+ margin = { top: 20, right: 20, bottom: 30, left: 40 };
88
+ // Tooltip state
89
+ _tooltipVisible = signal(false);
90
+ _tooltipPosition = signal({ x: 0, y: 0 });
91
+ _tooltipData = signal({
92
+ title: '',
93
+ value: '0',
94
+ percentage: '0%',
95
+ color: '',
96
+ });
97
+ // Signals for component state
98
+ _initialized = signal(false);
99
+ _rendered = signal(false);
100
+ // Tooltip accessors
101
+ tooltipVisible = this._tooltipVisible.asReadonly();
102
+ tooltipPosition = this._tooltipPosition.asReadonly();
103
+ tooltipData = this._tooltipData.asReadonly();
104
+ // Inject configuration
105
+ configToken = inject(AX_BAR_CHART_CONFIG);
106
+ // Configuration with defaults
107
+ effectiveOptions = computed(() => {
108
+ return {
109
+ ...this.configToken,
110
+ ...this.options(),
111
+ };
112
+ });
113
+ constructor() {
114
+ // Dynamically load D3 and initialize the chart when the component is ready
115
+ afterNextRender(() => {
116
+ this._initialized.set(true);
117
+ this.loadD3();
118
+ // Create chart after D3 is loaded and container is available
119
+ if (this.d3 && this.chartContainerEl()) {
120
+ this.createChart();
121
+ this._rendered.set(true);
122
+ }
123
+ });
124
+ // Watch for changes to redraw the chart
125
+ effect(() => {
126
+ // Access inputs to track them
127
+ this.data();
128
+ this.effectiveOptions();
129
+ // Only update if already rendered
130
+ if (this._rendered()) {
131
+ this.updateChart();
132
+ }
133
+ });
134
+ }
135
+ ngOnDestroy() {
136
+ this.cleanupChart();
137
+ }
138
+ /**
139
+ * Loads D3.js dynamically
140
+ */
141
+ async loadD3() {
142
+ try {
143
+ this.d3 = await import('d3');
144
+ // If container is ready, create chart
145
+ if (this._initialized() && this.chartContainerEl()) {
146
+ this.createChart();
147
+ this._rendered.set(true);
148
+ }
149
+ }
150
+ catch (error) {
151
+ console.error('Failed to load D3.js:', error);
152
+ }
153
+ }
154
+ /**
155
+ * Creates the bar chart SVG and renders all elements
156
+ */
157
+ createChart() {
158
+ if (!this.d3 || !this.chartContainerEl()?.nativeElement)
159
+ return;
160
+ const containerElement = this.chartContainerEl().nativeElement;
161
+ const data = this.data() || [];
162
+ // Clear existing chart
163
+ this.d3.select(containerElement).selectAll('svg').remove();
164
+ // Early return if no data
165
+ if (!data.length) {
166
+ this.showNoDataMessage(containerElement);
167
+ return;
168
+ }
169
+ // Get options and setup dimensions
170
+ const chartOptions = this.effectiveOptions();
171
+ this.setupDimensions(containerElement, chartOptions);
172
+ // Create scales and axes
173
+ this.setupScales(data);
174
+ this.createAxes(chartOptions);
175
+ // Render the bars
176
+ this.renderBars(data);
177
+ }
178
+ /**
179
+ * Updates the chart when inputs change
180
+ */
181
+ updateChart() {
182
+ this.createChart();
183
+ }
184
+ /**
185
+ * Cleans up chart resources
186
+ */
187
+ cleanupChart() {
188
+ if (this.svg) {
189
+ this.d3?.select(this.chartContainerEl()?.nativeElement).selectAll('svg').remove();
190
+ this.svg = null;
191
+ this.chart = null;
192
+ }
193
+ this._tooltipVisible.set(false);
194
+ }
195
+ /**
196
+ * Sets up chart dimensions and creates SVG with responsive attributes
197
+ */
198
+ setupDimensions(containerElement, options) {
199
+ // Calculate margins based on options
200
+ this.calculateMargins(options);
201
+ // Get container dimensions
202
+ const containerWidth = containerElement.clientWidth;
203
+ const containerHeight = containerElement.clientHeight;
204
+ // If options specify width and height, use those, otherwise default to container size
205
+ const minDim = Math.min(200, containerWidth, containerHeight); // Ensure reasonable minimum
206
+ if (options.width && options.height) {
207
+ // Explicit dimensions provided
208
+ this.width = options.width - this.margin.left - this.margin.right;
209
+ this.height = options.height - this.margin.top - this.margin.bottom;
210
+ }
211
+ else {
212
+ // Responsive dimensions
213
+ this.width = Math.max(containerWidth, minDim) - this.margin.left - this.margin.right;
214
+ this.height = Math.max(containerHeight, minDim) - this.margin.top - this.margin.bottom;
215
+ }
216
+ // Create responsive SVG that scales with its container
217
+ const svg = this.d3
218
+ .select(containerElement)
219
+ .append('svg')
220
+ .attr('width', '100%')
221
+ .attr('height', '100%')
222
+ .attr('viewBox', `0 0 ${this.width + this.margin.left + this.margin.right} ${this.height + this.margin.top + this.margin.bottom}`)
223
+ .attr('preserveAspectRatio', 'xMidYMid meet');
224
+ this.svg = svg;
225
+ // Create chart group with margins
226
+ this.chart = this.svg.append('g').attr('transform', `translate(${this.margin.left},${this.margin.top})`);
227
+ }
228
+ /**
229
+ * Calculates chart margins based on options
230
+ */
231
+ calculateMargins(options) {
232
+ // Start with default margins
233
+ this.margin = {
234
+ top: options.margin?.top ?? 20,
235
+ right: options.margin?.right ?? 20,
236
+ bottom: options.margin?.bottom ?? 30,
237
+ left: options.margin?.left ?? 40,
238
+ };
239
+ // Adjust margins if axis labels are present
240
+ if (options.xAxisLabel) {
241
+ const xLabelLength = options.xAxisLabel.length;
242
+ const extraBottomMargin = Math.min(20, Math.max(10, xLabelLength * 0.8));
243
+ this.margin.bottom = Math.max(this.margin.bottom, 30 + extraBottomMargin);
244
+ }
245
+ if (options.yAxisLabel) {
246
+ const yLabelLength = options.yAxisLabel.length;
247
+ const extraLeftMargin = Math.min(20, Math.max(10, yLabelLength * 0.8));
248
+ this.margin.left = Math.max(this.margin.left, 40 + extraLeftMargin);
249
+ }
250
+ // Ensure minimum margins for axes
251
+ if (options.showXAxis !== false) {
252
+ this.margin.bottom = Math.max(this.margin.bottom, 35);
253
+ }
254
+ if (options.showYAxis !== false) {
255
+ this.margin.left = Math.max(this.margin.left, 45);
256
+ }
257
+ }
258
+ /**
259
+ * Creates x and y scales for the chart
260
+ */
261
+ setupScales(data) {
262
+ // Get the bar width percentage (default 80%)
263
+ const barWidthPercent = this.effectiveOptions().barWidth ?? 60 / 100;
264
+ // Calculate padding based on barWidth (inverse relationship)
265
+ const padding = Math.max(0.1, 1 - barWidthPercent);
266
+ // Create x scale (band scale for categorical data)
267
+ this.xScale = this.d3
268
+ .scaleBand()
269
+ .domain(data.map((d) => d.label))
270
+ .range([0, this.width])
271
+ .padding(padding);
272
+ // Create y scale (linear scale for values)
273
+ this.yScale = this.d3
274
+ .scaleLinear()
275
+ .domain([0, this.d3.max(data, (d) => d.value) || 0])
276
+ .nice()
277
+ .range([this.height, 0]);
278
+ }
279
+ /**
280
+ * Creates x and y axes with grid lines
281
+ */
282
+ createAxes(options) {
283
+ // Only create axes if they are enabled in options
284
+ const showXAxis = options.showXAxis !== false;
285
+ const showYAxis = options.showYAxis !== false;
286
+ const showGrid = options.showGrid !== false;
287
+ // Create a group for all axes
288
+ const axesGroup = this.chart.append('g').attr('class', 'ax-bar-chart-axes');
289
+ if (showXAxis) {
290
+ // Create X axis
291
+ this.xAxis = axesGroup
292
+ .append('g')
293
+ .attr('class', 'ax-bar-chart-axis-x')
294
+ .attr('transform', `translate(0,${this.height})`)
295
+ .call(this.d3.axisBottom(this.xScale));
296
+ // Style the axis text
297
+ this.xAxis.selectAll('text').style('font-size', '11px').style('font-weight', '400').style('fill', '#666');
298
+ // Add X axis label if provided
299
+ if (options.xAxisLabel) {
300
+ const labelY = this.height + this.margin.bottom * 0.65;
301
+ axesGroup
302
+ .append('text')
303
+ .attr('class', 'ax-bar-chart-axis-label ax-x-axis-label')
304
+ .attr('text-anchor', 'middle')
305
+ .attr('dominant-baseline', 'middle')
306
+ .attr('x', this.width / 2)
307
+ .attr('y', labelY)
308
+ .style('font-size', '13px')
309
+ .style('font-weight', '500')
310
+ .style('fill', '#555')
311
+ .text(options.xAxisLabel);
312
+ }
313
+ }
314
+ if (showYAxis) {
315
+ // Create Y axis
316
+ this.yAxis = axesGroup.append('g').attr('class', 'ax-bar-chart-axis-y').call(this.d3.axisLeft(this.yScale));
317
+ // Style the axis text
318
+ this.yAxis.selectAll('text').style('font-size', '11px').style('font-weight', '400').style('fill', '#666');
319
+ // Add Y axis label if provided
320
+ if (options.yAxisLabel) {
321
+ const labelX = -this.height / 2;
322
+ const labelY = -this.margin.left * 0.65;
323
+ axesGroup
324
+ .append('text')
325
+ .attr('class', 'ax-bar-chart-axis-label ax-y-axis-label')
326
+ .attr('text-anchor', 'middle')
327
+ .attr('dominant-baseline', 'middle')
328
+ .attr('transform', 'rotate(-90)')
329
+ .attr('x', labelX)
330
+ .attr('y', labelY)
331
+ .style('font-size', '13px')
332
+ .style('font-weight', '500')
333
+ .style('fill', '#555')
334
+ .text(options.yAxisLabel);
335
+ }
336
+ }
337
+ if (showGrid) {
338
+ // Add horizontal grid lines
339
+ this.chart
340
+ .append('g')
341
+ .attr('class', 'ax-bar-chart-grid')
342
+ .call(this.d3
343
+ .axisLeft(this.yScale)
344
+ .tickSize(-this.width)
345
+ .tickFormat(() => ''))
346
+ .selectAll('.tick')
347
+ .style('color', 'rgb(153 153 153 / 30%)'); // Add gray color to ticks
348
+ }
349
+ }
350
+ /**
351
+ * Renders the bars with animations
352
+ */
353
+ renderBars(data) {
354
+ // Get corner radius from options
355
+ const radius = this.effectiveOptions().cornerRadius;
356
+ // Get animation options
357
+ const animationDuration = this.effectiveOptions().animationDuration;
358
+ const animationEasing = this.getEasingFunction(this.effectiveOptions().animationEasing);
359
+ // Create a container for all bars
360
+ const barsContainer = this.chart.append('g').attr('class', 'ax-bar-chart-bars-container');
361
+ // Create groups for each bar to handle transformations
362
+ const barGroups = barsContainer
363
+ .selectAll('.ax-bar-chart-bar-group')
364
+ .data(data)
365
+ .enter()
366
+ .append('g')
367
+ .style('cursor', 'pointer')
368
+ .attr('class', 'ax-bar-chart-bar-group');
369
+ // Add bars inside groups
370
+ const bars = barGroups
371
+ .append('rect')
372
+ .attr('class', 'ax-bar-chart-bar')
373
+ .attr('x', (d) => this.xScale(d.label))
374
+ .attr('width', this.xScale.bandwidth())
375
+ .attr('y', this.height) // Start from bottom for animation
376
+ .attr('height', 0) // Start with height 0 for animation
377
+ .attr('rx', radius) // Rounded corners
378
+ .attr('ry', radius) // Rounded corners
379
+ .attr('fill', (d, i) => d.color || AXBarChartColors.getColor(i));
380
+ // Set up event handlers on each group
381
+ barGroups
382
+ .on('mouseenter', (event, d) => {
383
+ const barEl = this.d3.select(event.currentTarget).select('rect');
384
+ const currentX = parseFloat(barEl.attr('x'));
385
+ const currentY = parseFloat(barEl.attr('y'));
386
+ const currentWidth = parseFloat(barEl.attr('width'));
387
+ const currentHeight = parseFloat(barEl.attr('height'));
388
+ // Calculate horizontal center point of the bar
389
+ const centerX = currentX + currentWidth / 2;
390
+ // Scale amount (5% larger)
391
+ const scaleX = 1.05;
392
+ const scaleY = 1.05;
393
+ // Calculate new dimensions with scaling
394
+ const newWidth = currentWidth * scaleX;
395
+ const newHeight = currentHeight * scaleY;
396
+ // Calculate new position:
397
+ // - Horizontally center-aligned
398
+ // - Vertically grow only upward from the bottom (X-axis)
399
+ const newX = centerX - newWidth / 2;
400
+ // The bottom of the bar stays at the same position (aligned with x-axis)
401
+ const newY = currentY - (newHeight - currentHeight);
402
+ // Apply the new position and size
403
+ barEl
404
+ .transition()
405
+ .duration(200)
406
+ .attr('x', newX)
407
+ .attr('y', newY)
408
+ .attr('width', newWidth)
409
+ .attr('height', newHeight);
410
+ this.handleBarHover(event, d);
411
+ })
412
+ .on('mousemove', (event) => this.updateTooltipPosition(event))
413
+ .on('mouseleave', (event, d) => {
414
+ const barEl = this.d3.select(event.currentTarget).select('rect');
415
+ // Restore original position and size
416
+ barEl
417
+ .transition()
418
+ .duration(200)
419
+ .attr('x', (d) => this.xScale(d.label))
420
+ .attr('y', (d) => this.yScale(d.value))
421
+ .attr('width', this.xScale.bandwidth())
422
+ .attr('height', (d) => this.height - this.yScale(d.value));
423
+ this._tooltipVisible.set(false);
424
+ })
425
+ .on('click', (event, d) => this.handleBarClick(event, d));
426
+ // Add animation
427
+ bars
428
+ .transition()
429
+ .duration(animationDuration)
430
+ .delay((d, i) => i * 50) // Stagger each bar animation
431
+ .attr('y', (d) => this.yScale(d.value))
432
+ .attr('height', (d) => this.height - this.yScale(d.value))
433
+ .ease(animationEasing); // Use the configured easing function
434
+ }
435
+ /**
436
+ * Gets the appropriate D3 easing function based on the option string
437
+ */
438
+ getEasingFunction(easing) {
439
+ switch (easing) {
440
+ case 'linear':
441
+ return this.d3.easeLinear;
442
+ case 'ease':
443
+ return this.d3.easePolyInOut;
444
+ case 'ease-in':
445
+ return this.d3.easePolyIn;
446
+ case 'ease-out':
447
+ return this.d3.easePolyOut;
448
+ case 'ease-in-out':
449
+ return this.d3.easePolyInOut;
450
+ case 'cubic':
451
+ return this.d3.easeCubic;
452
+ case 'cubic-in':
453
+ return this.d3.easeCubicIn;
454
+ case 'cubic-out':
455
+ return this.d3.easeCubicOut;
456
+ case 'cubic-in-out':
457
+ return this.d3.easeCubicInOut;
458
+ default:
459
+ return this.d3.easeCubicOut; // Default easing
460
+ }
461
+ }
462
+ /**
463
+ * Handles bar hover event and shows tooltip
464
+ */
465
+ handleBarHover(event, datum) {
466
+ if (this.effectiveOptions().showTooltip !== false) {
467
+ const index = this.data().findIndex((item) => item.id === datum.id);
468
+ const color = datum.color || AXBarChartColors.getColor(index);
469
+ // Calculate percentage of total
470
+ const total = this.data().reduce((sum, item) => sum + item.value, 0);
471
+ const percentage = total > 0 ? ((datum.value / total) * 100).toFixed(1) : '0';
472
+ this._tooltipData.set({
473
+ title: datum.label,
474
+ value: datum.value.toString(),
475
+ percentage: `${percentage}%`,
476
+ color: color,
477
+ });
478
+ this.updateTooltipPosition(event);
479
+ this._tooltipVisible.set(true);
480
+ }
481
+ }
482
+ /**
483
+ * Updates tooltip position based on mouse coordinates
484
+ */
485
+ updateTooltipPosition(event) {
486
+ const container = this.chartContainerEl().nativeElement.getBoundingClientRect();
487
+ const tooltipEl = this.chartContainerEl().nativeElement.querySelector('.chart-tooltip');
488
+ if (!tooltipEl) {
489
+ const x = event.clientX - container.left;
490
+ const y = event.clientY - container.top;
491
+ this._tooltipPosition.set({ x, y });
492
+ return;
493
+ }
494
+ const tooltipRect = tooltipEl.getBoundingClientRect();
495
+ let x = event.clientX - container.left;
496
+ let y = event.clientY - container.top;
497
+ // Adjust position if near the right edge
498
+ if (x + tooltipRect.width + 10 > container.width) {
499
+ x = x - tooltipRect.width - 10;
500
+ }
501
+ else {
502
+ x = x + 10;
503
+ }
504
+ // Adjust vertical position to ensure tooltip stays within container
505
+ if (y + tooltipRect.height / 2 > container.height) {
506
+ y = container.height - tooltipRect.height / 2;
507
+ }
508
+ else if (y - tooltipRect.height / 2 < 0) {
509
+ y = tooltipRect.height / 2;
510
+ }
511
+ this._tooltipPosition.set({ x, y });
512
+ }
513
+ /**
514
+ * Handles bar click event
515
+ */
516
+ handleBarClick(event, datum) {
517
+ this.barClick.emit({ item: datum, event });
518
+ }
519
+ /**
520
+ * Shows a message when no data is available
521
+ */
522
+ showNoDataMessage(containerElement) {
523
+ const messageContainer = this.d3
524
+ .select(containerElement)
525
+ .append('div')
526
+ .attr('class', 'ax-bar-chart-no-data-message')
527
+ .style('width', '100%')
528
+ .style('height', '100%')
529
+ .style('display', 'flex')
530
+ .style('flex-direction', 'column')
531
+ .style('align-items', 'center')
532
+ .style('justify-content', 'center')
533
+ .style('text-align', 'center');
534
+ // Add an icon
535
+ messageContainer
536
+ .append('div')
537
+ .attr('class', 'ax-bar-chart-no-data-icon')
538
+ .style('margin-bottom', '10px')
539
+ .style('color', 'var(--ax-text-muted, #999)')
540
+ .html('<i class="fa-light fa-chart-bar fa-2x"></i>');
541
+ // Add text message
542
+ messageContainer
543
+ .append('div')
544
+ .attr('class', 'ax-bar-chart-no-data-text')
545
+ .style('font-size', '16px')
546
+ .style('font-weight', '600')
547
+ .style('color', 'var(--ax-text-color, #333)')
548
+ .text('No data available');
549
+ }
550
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: AXBarChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
551
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.9", type: AXBarChartComponent, isStandalone: true, selector: "ax-bar-chart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { barClick: "barClick" }, viewQueries: [{ propertyName: "chartContainerEl", first: true, predicate: ["chartContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ax-bar-chart\" #chartContainer>\n <!-- Shared tooltip component -->\n <ax-chart-tooltip\n [visible]=\"tooltipVisible()\"\n [position]=\"tooltipPosition()\"\n [data]=\"tooltipData()\"\n [showPercentage]=\"true\"\n ></ax-chart-tooltip>\n</div>\n", styles: [":host{display:block;width:100%;height:100%;min-height:200px}.ax-bar-chart{width:100%;height:100%;position:relative;display:flex;align-items:center;justify-content:center;border-radius:.5rem;overflow:hidden}.ax-bar-chart svg{width:100%;height:100%;max-width:100%;max-height:100%;overflow:visible}.ax-bar-chart-bar{transition:all .3s cubic-bezier(.4,0,.2,1);cursor:pointer}.ax-bar-chart-bar:hover{filter:brightness(.9);transform:translateY(-3px)}.ax-bar-chart-axis-x path,.ax-bar-chart-axis-y path{stroke:var(--ax-border-color, #e0e0e0)}.ax-bar-chart-axis-x line,.ax-bar-chart-axis-y line,.ax-bar-chart-grid line{stroke:var(--ax-border-color, #e0e0e0);stroke-dasharray:2,2;stroke-opacity:.5}.ax-bar-chart-grid path{stroke-width:0}.ax-bar-chart-axis-x text,.ax-bar-chart-axis-y text{fill:var(--ax-text-muted, #666);font-size:clamp(8px,2vmin,12px)}.ax-bar-chart-no-data-message{font-family:var(--ax-font-family, system-ui, sans-serif);display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:1rem;width:100%;height:100%}.ax-bar-chart-no-data-icon{margin-bottom:.75rem;color:var(--ax-text-muted, #999)}.ax-bar-chart-no-data-text{font-weight:600;color:var(--ax-text-color, #333)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: AXChartTooltipComponent, selector: "ax-chart-tooltip", inputs: ["data", "position", "visible", "showPercentage", "style"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
552
+ }
553
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: AXBarChartComponent, decorators: [{
554
+ type: Component,
555
+ args: [{ selector: 'ax-bar-chart', standalone: true, imports: [CommonModule, AXChartTooltipComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"ax-bar-chart\" #chartContainer>\n <!-- Shared tooltip component -->\n <ax-chart-tooltip\n [visible]=\"tooltipVisible()\"\n [position]=\"tooltipPosition()\"\n [data]=\"tooltipData()\"\n [showPercentage]=\"true\"\n ></ax-chart-tooltip>\n</div>\n", styles: [":host{display:block;width:100%;height:100%;min-height:200px}.ax-bar-chart{width:100%;height:100%;position:relative;display:flex;align-items:center;justify-content:center;border-radius:.5rem;overflow:hidden}.ax-bar-chart svg{width:100%;height:100%;max-width:100%;max-height:100%;overflow:visible}.ax-bar-chart-bar{transition:all .3s cubic-bezier(.4,0,.2,1);cursor:pointer}.ax-bar-chart-bar:hover{filter:brightness(.9);transform:translateY(-3px)}.ax-bar-chart-axis-x path,.ax-bar-chart-axis-y path{stroke:var(--ax-border-color, #e0e0e0)}.ax-bar-chart-axis-x line,.ax-bar-chart-axis-y line,.ax-bar-chart-grid line{stroke:var(--ax-border-color, #e0e0e0);stroke-dasharray:2,2;stroke-opacity:.5}.ax-bar-chart-grid path{stroke-width:0}.ax-bar-chart-axis-x text,.ax-bar-chart-axis-y text{fill:var(--ax-text-muted, #666);font-size:clamp(8px,2vmin,12px)}.ax-bar-chart-no-data-message{font-family:var(--ax-font-family, system-ui, sans-serif);display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:1rem;width:100%;height:100%}.ax-bar-chart-no-data-icon{margin-bottom:.75rem;color:var(--ax-text-muted, #999)}.ax-bar-chart-no-data-text{font-weight:600;color:var(--ax-text-color, #333)}\n"] }]
556
+ }], ctorParameters: () => [] });
557
+
558
+ /**
559
+ * Generated bundle index. Do not edit.
560
+ */
561
+
562
+ export { AXBarChartColors, AXBarChartComponent, AXBarChartDefaultConfig, AX_BAR_CHART_CONFIG, barChartConfig };
563
+ //# sourceMappingURL=acorex-charts-bar-chart.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-charts-bar-chart.mjs","sources":["../../../../libs/charts/bar-chart/src/lib/bar-chart.config.ts","../../../../libs/charts/bar-chart/src/lib/bar-chart.component.ts","../../../../libs/charts/bar-chart/src/lib/bar-chart.component.html","../../../../libs/charts/bar-chart/src/acorex-charts-bar-chart.ts"],"sourcesContent":["import { AX_GLOBAL_CONFIG } from '@acorex/core/config';\nimport { InjectionToken, inject } from '@angular/core';\nimport { set } from 'lodash-es';\nimport { AXPBarChartOption } from './bar-chart.type';\n\nexport const AXBarChartDefaultConfig: AXPBarChartOption = {\n margin: {\n top: 20,\n right: 20,\n bottom: 30,\n left: 40,\n },\n showXAxis: true,\n showYAxis: true,\n showGrid: true,\n showTooltip: true,\n barWidth: 80,\n cornerRadius: 4,\n animationDuration: 800,\n animationEasing: 'cubic-out',\n};\n\nexport const AX_BAR_CHART_CONFIG = new InjectionToken<AXPBarChartOption>('AX_BAR_CHART_CONFIG', {\n providedIn: 'root',\n factory: () => {\n const global = inject(AX_GLOBAL_CONFIG);\n set(global, 'chart.barChart', AXBarChartDefaultConfig);\n return AXBarChartDefaultConfig;\n },\n});\n\nexport type PartialBarChartConfig = Partial<AXPBarChartOption>;\n\nexport function barChartConfig(config: PartialBarChartConfig = {}): AXPBarChartOption {\n const result = {\n ...AXBarChartDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { AXChartTooltipComponent, AXChartTooltipData } from '@acorex/charts/chart-tooltip';\nimport { CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n OnDestroy,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport { AX_BAR_CHART_CONFIG } from './bar-chart.config';\nimport { AXBarChartClickEvent, AXPBarChartData, AXPBarChartOption } from './bar-chart.type';\n\nexport const AXBarChartColors = {\n // Modern color palette suitable for data visualization\n defaultColors: [\n '#4361ee', // Blue\n '#3a0ca3', // Purple\n '#7209b7', // Violet\n '#f72585', // Pink\n '#4cc9f0', // Light Blue\n '#4895ef', // Sky Blue\n '#560bad', // Deep Purple\n '#f15bb5', // Light Pink\n '#00bbf9', // Cyan\n '#00f5d4', // Teal\n ],\n\n // Get a color from the palette by index with wraparound\n getColor: (index: number, customPalette?: string[]): string => {\n const palette = customPalette || AXBarChartColors.defaultColors;\n return palette[index % palette.length];\n },\n};\n\n/**\n * Bar Chart Component\n * Renders data as vertical bars with interactive hover effects and animations\n */\n@Component({\n selector: 'ax-bar-chart',\n templateUrl: './bar-chart.component.html',\n styleUrls: ['./bar-chart.component.scss'],\n standalone: true,\n imports: [CommonModule, AXChartTooltipComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AXBarChartComponent implements OnDestroy {\n // Inputs\n /** Chart data input */\n data = input<AXPBarChartData[]>([]);\n\n /** Chart options input */\n options = input<AXPBarChartOption>({});\n\n // Outputs\n /** Emitted when a bar is clicked */\n barClick = output<AXBarChartClickEvent>();\n\n // Chart container reference\n private readonly chartContainerEl = viewChild.required<ElementRef<HTMLDivElement>>('chartContainer');\n\n // D3 reference - loaded asynchronously\n protected d3!: typeof import('d3');\n\n // Chart elements\n private svg!: any;\n private chart!: any;\n private xScale!: any;\n private yScale!: any;\n private xAxis!: any;\n private yAxis!: any;\n\n // Chart dimensions\n private width!: number;\n private height!: number;\n private margin = { top: 20, right: 20, bottom: 30, left: 40 };\n\n // Tooltip state\n private _tooltipVisible = signal(false);\n private _tooltipPosition = signal({ x: 0, y: 0 });\n private _tooltipData = signal<AXChartTooltipData>({\n title: '',\n value: '0',\n percentage: '0%',\n color: '',\n });\n\n // Signals for component state\n private _initialized = signal(false);\n private _rendered = signal(false);\n\n // Tooltip accessors\n protected tooltipVisible = this._tooltipVisible.asReadonly();\n protected tooltipPosition = this._tooltipPosition.asReadonly();\n protected tooltipData = this._tooltipData.asReadonly();\n\n // Inject configuration\n private configToken = inject(AX_BAR_CHART_CONFIG);\n\n // Configuration with defaults\n protected effectiveOptions = computed(() => {\n return {\n ...this.configToken,\n ...this.options(),\n };\n });\n\n constructor() {\n // Dynamically load D3 and initialize the chart when the component is ready\n afterNextRender(() => {\n this._initialized.set(true);\n this.loadD3();\n // Create chart after D3 is loaded and container is available\n if (this.d3 && this.chartContainerEl()) {\n this.createChart();\n this._rendered.set(true);\n }\n });\n\n // Watch for changes to redraw the chart\n effect(() => {\n // Access inputs to track them\n this.data();\n this.effectiveOptions();\n\n // Only update if already rendered\n if (this._rendered()) {\n this.updateChart();\n }\n });\n }\n\n ngOnDestroy(): void {\n this.cleanupChart();\n }\n\n /**\n * Loads D3.js dynamically\n */\n protected async loadD3(): Promise<void> {\n try {\n this.d3 = await import('d3');\n // If container is ready, create chart\n if (this._initialized() && this.chartContainerEl()) {\n this.createChart();\n this._rendered.set(true);\n }\n } catch (error) {\n console.error('Failed to load D3.js:', error);\n }\n }\n\n /**\n * Creates the bar chart SVG and renders all elements\n */\n protected createChart(): void {\n if (!this.d3 || !this.chartContainerEl()?.nativeElement) return;\n\n const containerElement = this.chartContainerEl().nativeElement;\n const data = this.data() || [];\n\n // Clear existing chart\n this.d3.select(containerElement).selectAll('svg').remove();\n\n // Early return if no data\n if (!data.length) {\n this.showNoDataMessage(containerElement);\n return;\n }\n\n // Get options and setup dimensions\n const chartOptions = this.effectiveOptions();\n this.setupDimensions(containerElement, chartOptions);\n\n // Create scales and axes\n this.setupScales(data);\n this.createAxes(chartOptions);\n\n // Render the bars\n this.renderBars(data);\n }\n\n /**\n * Updates the chart when inputs change\n */\n protected updateChart(): void {\n this.createChart();\n }\n\n /**\n * Cleans up chart resources\n */\n protected cleanupChart(): void {\n if (this.svg) {\n this.d3?.select(this.chartContainerEl()?.nativeElement).selectAll('svg').remove();\n this.svg = null;\n this.chart = null;\n }\n this._tooltipVisible.set(false);\n }\n\n /**\n * Sets up chart dimensions and creates SVG with responsive attributes\n */\n private setupDimensions(containerElement: HTMLElement, options: AXPBarChartOption): void {\n // Calculate margins based on options\n this.calculateMargins(options);\n\n // Get container dimensions\n const containerWidth = containerElement.clientWidth;\n const containerHeight = containerElement.clientHeight;\n\n // If options specify width and height, use those, otherwise default to container size\n const minDim = Math.min(200, containerWidth, containerHeight); // Ensure reasonable minimum\n\n if (options.width && options.height) {\n // Explicit dimensions provided\n this.width = options.width - this.margin.left - this.margin.right;\n this.height = options.height - this.margin.top - this.margin.bottom;\n } else {\n // Responsive dimensions\n this.width = Math.max(containerWidth, minDim) - this.margin.left - this.margin.right;\n this.height = Math.max(containerHeight, minDim) - this.margin.top - this.margin.bottom;\n }\n\n // Create responsive SVG that scales with its container\n const svg = this.d3\n .select(containerElement)\n .append('svg')\n .attr('width', '100%')\n .attr('height', '100%')\n .attr(\n 'viewBox',\n `0 0 ${this.width + this.margin.left + this.margin.right} ${this.height + this.margin.top + this.margin.bottom}`,\n )\n .attr('preserveAspectRatio', 'xMidYMid meet');\n\n this.svg = svg;\n\n // Create chart group with margins\n this.chart = this.svg.append('g').attr('transform', `translate(${this.margin.left},${this.margin.top})`);\n }\n\n /**\n * Calculates chart margins based on options\n */\n private calculateMargins(options: AXPBarChartOption): void {\n // Start with default margins\n this.margin = {\n top: options.margin?.top ?? 20,\n right: options.margin?.right ?? 20,\n bottom: options.margin?.bottom ?? 30,\n left: options.margin?.left ?? 40,\n };\n\n // Adjust margins if axis labels are present\n if (options.xAxisLabel) {\n const xLabelLength = options.xAxisLabel.length;\n const extraBottomMargin = Math.min(20, Math.max(10, xLabelLength * 0.8));\n this.margin.bottom = Math.max(this.margin.bottom, 30 + extraBottomMargin);\n }\n\n if (options.yAxisLabel) {\n const yLabelLength = options.yAxisLabel.length;\n const extraLeftMargin = Math.min(20, Math.max(10, yLabelLength * 0.8));\n this.margin.left = Math.max(this.margin.left, 40 + extraLeftMargin);\n }\n\n // Ensure minimum margins for axes\n if (options.showXAxis !== false) {\n this.margin.bottom = Math.max(this.margin.bottom, 35);\n }\n\n if (options.showYAxis !== false) {\n this.margin.left = Math.max(this.margin.left, 45);\n }\n }\n\n /**\n * Creates x and y scales for the chart\n */\n private setupScales(data: AXPBarChartData[]): void {\n // Get the bar width percentage (default 80%)\n const barWidthPercent = this.effectiveOptions().barWidth ?? 60 / 100;\n // Calculate padding based on barWidth (inverse relationship)\n const padding = Math.max(0.1, 1 - barWidthPercent);\n\n // Create x scale (band scale for categorical data)\n this.xScale = this.d3\n .scaleBand()\n .domain(data.map((d) => d.label))\n .range([0, this.width])\n .padding(padding);\n\n // Create y scale (linear scale for values)\n this.yScale = this.d3\n .scaleLinear()\n .domain([0, this.d3.max(data, (d) => d.value) || 0])\n .nice()\n .range([this.height, 0]);\n }\n\n /**\n * Creates x and y axes with grid lines\n */\n private createAxes(options: AXPBarChartOption): void {\n // Only create axes if they are enabled in options\n const showXAxis = options.showXAxis !== false;\n const showYAxis = options.showYAxis !== false;\n const showGrid = options.showGrid !== false;\n\n // Create a group for all axes\n const axesGroup = this.chart.append('g').attr('class', 'ax-bar-chart-axes');\n\n if (showXAxis) {\n // Create X axis\n this.xAxis = axesGroup\n .append('g')\n .attr('class', 'ax-bar-chart-axis-x')\n .attr('transform', `translate(0,${this.height})`)\n .call(this.d3.axisBottom(this.xScale));\n\n // Style the axis text\n this.xAxis.selectAll('text').style('font-size', '11px').style('font-weight', '400').style('fill', '#666');\n\n // Add X axis label if provided\n if (options.xAxisLabel) {\n const labelY = this.height + this.margin.bottom * 0.65;\n\n axesGroup\n .append('text')\n .attr('class', 'ax-bar-chart-axis-label ax-x-axis-label')\n .attr('text-anchor', 'middle')\n .attr('dominant-baseline', 'middle')\n .attr('x', this.width / 2)\n .attr('y', labelY)\n .style('font-size', '13px')\n .style('font-weight', '500')\n .style('fill', '#555')\n .text(options.xAxisLabel);\n }\n }\n\n if (showYAxis) {\n // Create Y axis\n this.yAxis = axesGroup.append('g').attr('class', 'ax-bar-chart-axis-y').call(this.d3.axisLeft(this.yScale));\n\n // Style the axis text\n this.yAxis.selectAll('text').style('font-size', '11px').style('font-weight', '400').style('fill', '#666');\n\n // Add Y axis label if provided\n if (options.yAxisLabel) {\n const labelX = -this.height / 2;\n const labelY = -this.margin.left * 0.65;\n\n axesGroup\n .append('text')\n .attr('class', 'ax-bar-chart-axis-label ax-y-axis-label')\n .attr('text-anchor', 'middle')\n .attr('dominant-baseline', 'middle')\n .attr('transform', 'rotate(-90)')\n .attr('x', labelX)\n .attr('y', labelY)\n .style('font-size', '13px')\n .style('font-weight', '500')\n .style('fill', '#555')\n .text(options.yAxisLabel);\n }\n }\n\n if (showGrid) {\n // Add horizontal grid lines\n this.chart\n .append('g')\n .attr('class', 'ax-bar-chart-grid')\n .call(\n this.d3\n .axisLeft(this.yScale)\n .tickSize(-this.width)\n .tickFormat(() => ''),\n )\n .selectAll('.tick')\n .style('color', 'rgb(153 153 153 / 30%)'); // Add gray color to ticks\n }\n }\n\n /**\n * Renders the bars with animations\n */\n private renderBars(data: AXPBarChartData[]): void {\n // Get corner radius from options\n const radius = this.effectiveOptions().cornerRadius;\n\n // Get animation options\n const animationDuration = this.effectiveOptions().animationDuration;\n const animationEasing = this.getEasingFunction(this.effectiveOptions().animationEasing);\n\n // Create a container for all bars\n const barsContainer = this.chart.append('g').attr('class', 'ax-bar-chart-bars-container');\n\n // Create groups for each bar to handle transformations\n const barGroups = barsContainer\n .selectAll('.ax-bar-chart-bar-group')\n .data(data)\n .enter()\n .append('g')\n .style('cursor', 'pointer')\n .attr('class', 'ax-bar-chart-bar-group');\n\n // Add bars inside groups\n const bars = barGroups\n .append('rect')\n .attr('class', 'ax-bar-chart-bar')\n .attr('x', (d: AXPBarChartData) => this.xScale(d.label))\n .attr('width', this.xScale.bandwidth())\n .attr('y', this.height) // Start from bottom for animation\n .attr('height', 0) // Start with height 0 for animation\n .attr('rx', radius) // Rounded corners\n .attr('ry', radius) // Rounded corners\n .attr('fill', (d: AXPBarChartData, i: number) => d.color || AXBarChartColors.getColor(i));\n\n // Set up event handlers on each group\n barGroups\n .on('mouseenter', (event: MouseEvent, d: AXPBarChartData) => {\n const barEl = this.d3.select(event.currentTarget).select('rect');\n const currentX = parseFloat(barEl.attr('x'));\n const currentY = parseFloat(barEl.attr('y'));\n const currentWidth = parseFloat(barEl.attr('width'));\n const currentHeight = parseFloat(barEl.attr('height'));\n\n // Calculate horizontal center point of the bar\n const centerX = currentX + currentWidth / 2;\n\n // Scale amount (5% larger)\n const scaleX = 1.05;\n const scaleY = 1.05;\n\n // Calculate new dimensions with scaling\n const newWidth = currentWidth * scaleX;\n const newHeight = currentHeight * scaleY;\n\n // Calculate new position:\n // - Horizontally center-aligned\n // - Vertically grow only upward from the bottom (X-axis)\n const newX = centerX - newWidth / 2;\n // The bottom of the bar stays at the same position (aligned with x-axis)\n const newY = currentY - (newHeight - currentHeight);\n\n // Apply the new position and size\n barEl\n .transition()\n .duration(200)\n .attr('x', newX)\n .attr('y', newY)\n .attr('width', newWidth)\n .attr('height', newHeight);\n\n this.handleBarHover(event, d);\n })\n .on('mousemove', (event: MouseEvent) => this.updateTooltipPosition(event))\n .on('mouseleave', (event: MouseEvent, d: AXPBarChartData) => {\n const barEl = this.d3.select(event.currentTarget).select('rect');\n\n // Restore original position and size\n barEl\n .transition()\n .duration(200)\n .attr('x', (d: AXPBarChartData) => this.xScale(d.label))\n .attr('y', (d: AXPBarChartData) => this.yScale(d.value))\n .attr('width', this.xScale.bandwidth())\n .attr('height', (d: AXPBarChartData) => this.height - this.yScale(d.value));\n\n this._tooltipVisible.set(false);\n })\n .on('click', (event: MouseEvent, d: AXPBarChartData) => this.handleBarClick(event, d));\n\n // Add animation\n bars\n .transition()\n .duration(animationDuration)\n .delay((d: AXPBarChartData, i: number) => i * 50) // Stagger each bar animation\n .attr('y', (d: AXPBarChartData) => this.yScale(d.value))\n .attr('height', (d: AXPBarChartData) => this.height - this.yScale(d.value))\n .ease(animationEasing); // Use the configured easing function\n }\n\n /**\n * Gets the appropriate D3 easing function based on the option string\n */\n private getEasingFunction(easing?: string): any {\n switch (easing) {\n case 'linear':\n return this.d3.easeLinear;\n case 'ease':\n return this.d3.easePolyInOut;\n case 'ease-in':\n return this.d3.easePolyIn;\n case 'ease-out':\n return this.d3.easePolyOut;\n case 'ease-in-out':\n return this.d3.easePolyInOut;\n case 'cubic':\n return this.d3.easeCubic;\n case 'cubic-in':\n return this.d3.easeCubicIn;\n case 'cubic-out':\n return this.d3.easeCubicOut;\n case 'cubic-in-out':\n return this.d3.easeCubicInOut;\n default:\n return this.d3.easeCubicOut; // Default easing\n }\n }\n\n /**\n * Handles bar hover event and shows tooltip\n */\n private handleBarHover(event: MouseEvent, datum: AXPBarChartData): void {\n if (this.effectiveOptions().showTooltip !== false) {\n const index = this.data().findIndex((item) => item.id === datum.id);\n const color = datum.color || AXBarChartColors.getColor(index);\n\n // Calculate percentage of total\n const total = this.data().reduce((sum, item) => sum + item.value, 0);\n const percentage = total > 0 ? ((datum.value / total) * 100).toFixed(1) : '0';\n\n this._tooltipData.set({\n title: datum.label,\n value: datum.value.toString(),\n percentage: `${percentage}%`,\n color: color,\n });\n\n this.updateTooltipPosition(event);\n this._tooltipVisible.set(true);\n }\n }\n\n /**\n * Updates tooltip position based on mouse coordinates\n */\n private updateTooltipPosition(event: MouseEvent): void {\n const container = this.chartContainerEl().nativeElement.getBoundingClientRect();\n const tooltipEl = this.chartContainerEl().nativeElement.querySelector('.chart-tooltip');\n\n if (!tooltipEl) {\n const x = event.clientX - container.left;\n const y = event.clientY - container.top;\n this._tooltipPosition.set({ x, y });\n return;\n }\n\n const tooltipRect = tooltipEl.getBoundingClientRect();\n let x = event.clientX - container.left;\n let y = event.clientY - container.top;\n\n // Adjust position if near the right edge\n if (x + tooltipRect.width + 10 > container.width) {\n x = x - tooltipRect.width - 10;\n } else {\n x = x + 10;\n }\n\n // Adjust vertical position to ensure tooltip stays within container\n if (y + tooltipRect.height / 2 > container.height) {\n y = container.height - tooltipRect.height / 2;\n } else if (y - tooltipRect.height / 2 < 0) {\n y = tooltipRect.height / 2;\n }\n\n this._tooltipPosition.set({ x, y });\n }\n\n /**\n * Handles bar click event\n */\n private handleBarClick(event: MouseEvent, datum: AXPBarChartData): void {\n this.barClick.emit({ item: datum, event });\n }\n\n /**\n * Shows a message when no data is available\n */\n private showNoDataMessage(containerElement: HTMLElement): void {\n const messageContainer = this.d3\n .select(containerElement)\n .append('div')\n .attr('class', 'ax-bar-chart-no-data-message')\n .style('width', '100%')\n .style('height', '100%')\n .style('display', 'flex')\n .style('flex-direction', 'column')\n .style('align-items', 'center')\n .style('justify-content', 'center')\n .style('text-align', 'center');\n\n // Add an icon\n messageContainer\n .append('div')\n .attr('class', 'ax-bar-chart-no-data-icon')\n .style('margin-bottom', '10px')\n .style('color', 'var(--ax-text-muted, #999)')\n .html('<i class=\"fa-light fa-chart-bar fa-2x\"></i>');\n\n // Add text message\n messageContainer\n .append('div')\n .attr('class', 'ax-bar-chart-no-data-text')\n .style('font-size', '16px')\n .style('font-weight', '600')\n .style('color', 'var(--ax-text-color, #333)')\n .text('No data available');\n }\n}\n","<div class=\"ax-bar-chart\" #chartContainer>\n <!-- Shared tooltip component -->\n <ax-chart-tooltip\n [visible]=\"tooltipVisible()\"\n [position]=\"tooltipPosition()\"\n [data]=\"tooltipData()\"\n [showPercentage]=\"true\"\n ></ax-chart-tooltip>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAKa,MAAA,uBAAuB,GAAsB;AACxD,IAAA,MAAM,EAAE;AACN,QAAA,GAAG,EAAE,EAAE;AACP,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,MAAM,EAAE,EAAE;AACV,QAAA,IAAI,EAAE,EAAE;AACT,KAAA;AACD,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,QAAQ,EAAE,EAAE;AACZ,IAAA,YAAY,EAAE,CAAC;AACf,IAAA,iBAAiB,EAAE,GAAG;AACtB,IAAA,eAAe,EAAE,WAAW;;MAGjB,mBAAmB,GAAG,IAAI,cAAc,CAAoB,qBAAqB,EAAE;AAC9F,IAAA,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,MAAK;AACZ,QAAA,MAAM,MAAM,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACvC,QAAA,GAAG,CAAC,MAAM,EAAE,gBAAgB,EAAE,uBAAuB,CAAC;AACtD,QAAA,OAAO,uBAAuB;KAC/B;AACF,CAAA;AAIe,SAAA,cAAc,CAAC,MAAA,GAAgC,EAAE,EAAA;AAC/D,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