@acorex/charts 21.0.2-next.4 → 21.0.2-next.40
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/fesm2022/acorex-charts-bar-chart.mjs +16 -16
- package/fesm2022/acorex-charts-bar-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-chart-legend.mjs +11 -11
- package/fesm2022/acorex-charts-chart-legend.mjs.map +1 -1
- package/fesm2022/acorex-charts-chart-tooltip.mjs +10 -10
- package/fesm2022/acorex-charts-chart-tooltip.mjs.map +1 -1
- package/fesm2022/acorex-charts-donut-chart.mjs +21 -20
- package/fesm2022/acorex-charts-donut-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-funnel-chart.mjs +12 -12
- package/fesm2022/acorex-charts-funnel-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-gauge-chart.mjs +13 -13
- package/fesm2022/acorex-charts-gauge-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-heatmap-chart.mjs +32 -17
- package/fesm2022/acorex-charts-heatmap-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-hierarchy-chart.mjs +34 -27
- package/fesm2022/acorex-charts-hierarchy-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-line-chart.mjs +55 -29
- package/fesm2022/acorex-charts-line-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts.mjs +4 -4
- package/fesm2022/acorex-charts.mjs.map +1 -1
- package/package.json +2 -1
- package/types/acorex-charts-heatmap-chart.d.ts +14 -0
- package/types/acorex-charts-hierarchy-chart.d.ts +5 -2
- package/types/acorex-charts-line-chart.d.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-charts-heatmap-chart.mjs","sources":["../../../../packages/charts/heatmap-chart/src/lib/heatmap-chart.config.ts","../../../../packages/charts/heatmap-chart/src/lib/heatmap-chart.component.ts","../../../../packages/charts/heatmap-chart/src/lib/heatmap-chart.component.html","../../../../packages/charts/heatmap-chart/src/acorex-charts-heatmap-chart.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { AXHeatmapChartOption } from './heatmap-chart.type';\n\nexport const AXHeatmapChartDefaultConfig: AXHeatmapChartOption = {\n margin: { top: 30, right: 30, bottom: 60, left: 60 },\n color: 'rgb(var(--ax-sys-color-primary-500))',\n cellPadding: 0.05,\n borderRadius: 2,\n showXAxis: true,\n showYAxis: true,\n rotateXAxisLabels: 'auto',\n showTooltip: true,\n animationDuration: 800,\n animationEasing: 'cubic-out',\n messages: {\n noData: 'No data available',\n noDataHelp: 'Provide X, Y, and Value data to render the heatmap',\n noDataIcon: 'fa-light fa-grid-2',\n },\n};\n\nexport const AX_HEATMAP_CHART_CONFIG = new InjectionToken<AXHeatmapChartOption>('AX_HEATMAP_CHART_CONFIG', {\n providedIn: 'root',\n factory: () => AXHeatmapChartDefaultConfig,\n});\n","import { AXChartComponent, computeTooltipPosition, getEasingFunction, resolveCssColorInContext } from '@acorex/charts';\nimport { AXChartTooltipComponent, AXChartTooltipData } from '@acorex/charts/chart-tooltip';\nimport { AXPlatform } from '@acorex/core/platform';\nimport {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n input,\n OnDestroy,\n output,\n signal,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { map, Subscription } from 'rxjs';\nimport { AX_HEATMAP_CHART_CONFIG } from './heatmap-chart.config';\nimport { AXHeatmapChartOption, AXHeatmapData } from './heatmap-chart.type';\n\n@Component({\n selector: 'ax-heatmap-chart',\n templateUrl: './heatmap-chart.component.html',\n styleUrls: ['./heatmap-chart.component.css'],\n encapsulation: ViewEncapsulation.None,\n imports: [AXChartTooltipComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AXHeatmapChartComponent extends AXChartComponent implements OnDestroy {\n /** Fixed `viewBox` side; chart scales with CSS `width` / `height` on the host container. */\n private static readonly VIEW_BOX_SIZE = 400;\n\n // X-axis layout (aligned with bar-chart heuristics)\n private readonly CHAR_WIDTH_RATIO = 0.65;\n private readonly ROTATION_TOLERANCE_SMALL_DATASET = 1.4;\n private readonly SMALL_DATASET_THRESHOLD = 6;\n private readonly MANY_ITEMS_THRESHOLD = 20;\n private readonly VERY_MANY_ITEMS_THRESHOLD = 50;\n private readonly MAX_LABEL_LENGTH = 20;\n private readonly TICK_AREA_PADDING = 6;\n private readonly X_AXIS_TITLE_GAP = 10;\n private readonly MIN_FONT_SIZE_X_AXIS = 8;\n private readonly MAX_FONT_SIZE_X_AXIS = 14;\n\n // Inject config at the top level\n private readonly defaultConfig = inject(AX_HEATMAP_CHART_CONFIG);\n\n // Inputs\n data = input<AXHeatmapData[]>([]);\n options = input<AXHeatmapChartOption>({});\n\n // Outputs\n /** Emitted when a heatmap cell is clicked */\n cellClick = output<AXHeatmapData>();\n\n // View Child\n private readonly containerRef = viewChild.required<ElementRef<HTMLDivElement>>('chartContainer');\n\n // Internal State\n private svg: any;\n protected d3: any;\n private _d3Ready = signal(false);\n private platformService = inject(AXPlatform);\n protected isRtl = signal(this.platformService.isRtl());\n private directionSub?: Subscription;\n\n // Tooltip State\n protected tooltipVisible = signal(false);\n protected tooltipPosition = signal({ x: 0, y: 0 });\n protected tooltipData = signal<AXChartTooltipData>({ title: '', value: '' });\n private _tooltipRafId: number | null = null;\n\n // Computed options (referencing the already injected defaultConfig)\n protected effectiveOptions = computed(() => ({\n ...this.defaultConfig,\n ...this.options(),\n }));\n\n constructor() {\n super();\n\n afterNextRender(() => {\n this.init();\n this.directionSub = this.platformService.directionChange.pipe(map((i) => i.data === 'rtl')).subscribe((isRtl) => {\n this.isRtl.set(isRtl);\n if (this._d3Ready()) {\n this.renderChart();\n }\n });\n });\n\n // Reactive render when data, options, or D3 readiness change\n effect(() => {\n this.data();\n this.effectiveOptions();\n if (this._d3Ready()) {\n this.renderChart();\n }\n });\n }\n\n private async init() {\n try {\n this.d3 = await import('d3');\n\n this._d3Ready.set(true);\n } catch (err) {\n console.error('Heatmap: Initialization failed', err);\n }\n }\n\n public updateChart(): void {\n this.renderChart();\n }\n\n private renderChart() {\n const container = this.containerRef().nativeElement;\n const data = this.data() || [];\n\n // Clear SVG if data is empty\n if (data.length === 0) {\n if (this.svg) this.svg.remove();\n this.svg = null;\n return;\n }\n\n const options = this.effectiveOptions();\n const width = AXHeatmapChartComponent.VIEW_BOX_SIZE;\n const height = AXHeatmapChartComponent.VIEW_BOX_SIZE;\n const isRtl = this.isRtl();\n const baseMargin = options.margin || { top: 20, right: 20, bottom: 40, left: 40 };\n // When rendering RTL, the Y axis is on the right; swap side margins so tick labels\n // have the same breathing room they get on the left in LTR.\n let margin = isRtl\n ? { top: baseMargin.top, right: baseMargin.left, bottom: baseMargin.bottom, left: baseMargin.right }\n : { ...baseMargin };\n\n const xKeys = Array.from(new Set(data.map((d) => d.x.toString())));\n const yKeys = Array.from(new Set(data.map((d) => d.y.toString())));\n\n let innerWidth = width - margin.left - margin.right;\n const cellPad = options.cellPadding ?? 0;\n const xScaleProbe = this.d3\n .scaleBand()\n .domain(xKeys)\n .range(isRtl ? [innerWidth, 0] : [0, innerWidth])\n .padding(cellPad);\n\n const xTickFontSize = this.getHeatmapXTickFontSize(innerWidth, xKeys.length);\n const { tickXKeys, formatXTick } = this.getHeatmapXTickPlan(xKeys);\n const longestXLabel = xKeys.reduce((acc, k) => {\n const t = formatXTick(k);\n return t.length > acc.length ? t : acc;\n }, '');\n const estimatedLabelWidth = longestXLabel.length * xTickFontSize * this.CHAR_WIDTH_RATIO;\n const step = xScaleProbe.step();\n const rotateX = this.shouldRotateHeatmapXLabels(options.rotateXAxisLabels, estimatedLabelWidth, step, xKeys.length);\n\n const tickAreaHeight = rotateX\n ? estimatedLabelWidth * Math.SQRT1_2 + xTickFontSize * Math.SQRT1_2 + this.TICK_AREA_PADDING\n : xTickFontSize + this.TICK_AREA_PADDING + 2;\n\n const xAxisTitleReserve = options.xAxisLabel?.trim() ? this.X_AXIS_TITLE_GAP + 16 : 0;\n margin = { ...margin, bottom: Math.max(margin.bottom, tickAreaHeight + xAxisTitleReserve) };\n\n innerWidth = width - margin.left - margin.right;\n const innerHeight = Math.max(1, height - margin.top - margin.bottom);\n\n // Create/Select SVG root\n if (!this.svg) {\n this.svg = this.d3\n .select(container)\n .append('svg')\n .attr('width', '100%')\n .attr('height', '100%')\n .attr('preserveAspectRatio', 'xMidYMid meet')\n .style('display', 'block');\n this.svg.append('g').attr('class', 'chart-group');\n }\n\n this.svg.attr('viewBox', `0 0 ${width} ${height}`);\n const g = this.svg.select('.chart-group').attr('transform', `translate(${margin.left},${margin.top})`);\n\n // --- Scales ---\n const xScale = this.d3\n .scaleBand()\n .domain(xKeys)\n .range(isRtl ? [innerWidth, 0] : [0, innerWidth])\n .padding(cellPad);\n const yScale = this.d3.scaleBand().domain(yKeys).range([innerHeight, 0]).padding(cellPad);\n\n const valueExtent = this.d3.extent(data, (d: any) => d.value) as [number, number];\n const minValue = Number.isFinite(valueExtent[0]) ? valueExtent[0] : 0;\n const maxValue = Number.isFinite(valueExtent[1]) ? valueExtent[1] : minValue + 1;\n const palette = options.colors?.filter(Boolean) ?? [];\n const baseColor = options.color ?? 'rgb(99, 102, 241)';\n const rangeMin = options.valueRange?.min ?? minValue;\n const rangeMax = options.valueRange?.max ?? maxValue;\n\n const resolvedColorCache = new Map<string, string>();\n const resolvePaletteColor = (c: string): string => {\n const hit = resolvedColorCache.get(c);\n if (hit !== undefined) return hit;\n const out = resolveCssColorInContext(container, c);\n resolvedColorCache.set(c, out);\n return out;\n };\n const resolvedBase = resolvePaletteColor(baseColor);\n\n const getCellColor = (d: AXHeatmapData): string => {\n // If a palette is provided, choose a stable \"random\" color per cell.\n if (palette.length > 0) {\n const key = `${d.x}-${d.y}`;\n const idx = this.hashStringToUint32(key) % palette.length;\n return resolvePaletteColor(palette[idx] ?? baseColor);\n }\n\n const span = rangeMax - rangeMin;\n const t = span === 0 ? 1 : (d.value - rangeMin) / span;\n const clamped = Math.max(0, Math.min(1, t));\n return this.applyIntensityToResolvedRgb(resolvedBase, clamped);\n };\n\n // --- Axes ---\n const xAxisBuilder = this.d3\n .axisBottom(xScale)\n .tickSize(0)\n .tickFormat((d: string | number) => formatXTick(String(d)));\n if (tickXKeys.length < xKeys.length) {\n xAxisBuilder.tickValues(tickXKeys);\n }\n\n this.drawAxis(g, 'x-axis', xAxisBuilder, 0, innerHeight, options.showXAxis, isRtl);\n g.select('.x-axis').attr('direction', 'ltr');\n this.styleHeatmapXAxisTicks(g, xTickFontSize, rotateX);\n\n if (isRtl) {\n this.drawAxis(g, 'y-axis', this.d3.axisRight(yScale).tickSize(0), innerWidth, 0, options.showYAxis, isRtl);\n } else {\n this.drawAxis(g, 'y-axis', this.d3.axisLeft(yScale).tickSize(0), 0, 0, options.showYAxis, isRtl);\n }\n this.drawAxisLabels(g, innerWidth, innerHeight, options, isRtl, tickAreaHeight);\n\n // --- Cells with Data Join ---\n const easing = getEasingFunction(this.d3, options.animationEasing);\n\n g.selectAll('.cell')\n .data(data, (d: any) => `${d.x}-${d.y}`)\n .join(\n (enter: any) => enter.append('rect').attr('class', 'cell').attr('opacity', 0).attr('fill', resolvedBase),\n (update: any) => update,\n (exit: any) => exit.transition().duration(200).attr('opacity', 0).remove(),\n )\n .on('mouseenter', (event: any, d: AXHeatmapData) => this.showTooltip(event, d, getCellColor(d)))\n .on('mousemove', (event: any) => this.updateTooltipPos(event))\n .on('click', (_event: any, d: AXHeatmapData) => this.cellClick.emit(d))\n .on('mouseleave', () => this.hideTooltip())\n .transition()\n .duration(options.animationDuration)\n .ease(easing)\n .attr('x', (d: any) => xScale(d.x.toString()))\n .attr('y', (d: any) => yScale(d.y.toString()))\n .attr('width', xScale.bandwidth())\n .attr('height', yScale.bandwidth())\n .attr('rx', options.borderRadius)\n .attr('ry', options.borderRadius)\n .attr('opacity', 1)\n .style('fill', (d: AXHeatmapData) => getCellColor(d));\n }\n\n private hashStringToUint32(input: string): number {\n // Simple, fast, deterministic hash (djb2 variant)\n let hash = 5381;\n for (let i = 0; i < input.length; i++) {\n hash = (hash * 33) ^ input.charCodeAt(i);\n }\n return hash >>> 0;\n }\n\n /** `resolvedRgb` must be a computed `rgb()` / `rgba()` string (e.g. from {@link resolveCssColorInContext}). */\n private applyIntensityToResolvedRgb(resolvedRgb: string, t: number): string {\n const clamped = Math.max(0, Math.min(1, t));\n const parsed = this.d3.color(resolvedRgb);\n if (!parsed) return resolvedRgb;\n const rgb = this.d3.rgb(parsed);\n const minOpacity = 0.12;\n const opacity = minOpacity + clamped * (1 - minOpacity);\n return `rgba(${Math.round(rgb.r)},${Math.round(rgb.g)},${Math.round(rgb.b)},${opacity})`;\n }\n\n private drawAxis(g: any, className: string, axisFn: any, x: number, y: number, visible = true, isRtl = false) {\n let axisG = g.select(`.${className}`);\n if (axisG.empty()) axisG = g.append('g').attr('class', className);\n\n axisG\n .attr('transform', `translate(${x},${y})`)\n .style('display', visible ? 'block' : 'none')\n .call(axisFn)\n .call((g: any) => g.select('.domain').remove());\n\n // Ensure tick labels don't overlap the plot in RTL.\n // `text-anchor` is logical (depends on `direction`), so we set both explicitly.\n axisG.attr('direction', isRtl ? 'rtl' : 'ltr');\n if (className === 'y-axis') {\n axisG.selectAll('.tick text').attr('text-anchor', 'end');\n }\n }\n\n private showTooltip(event: MouseEvent, item: AXHeatmapData, color: string) {\n if (!this.effectiveOptions().showTooltip) return;\n this.tooltipData.set({\n title: `${item.x} / ${item.y}`,\n value: item.label || item.value.toLocaleString(),\n color: color,\n });\n this.tooltipVisible.set(true);\n this.updateTooltipPos(event);\n }\n\n private updateTooltipPos(event: MouseEvent) {\n if (this._tooltipRafId) cancelAnimationFrame(this._tooltipRafId);\n this._tooltipRafId = requestAnimationFrame(() => {\n const containerEl = this.containerRef().nativeElement;\n const rect = containerEl.getBoundingClientRect();\n const tooltipEl = containerEl.querySelector('.chart-tooltip') as HTMLElement;\n const tooltipRect = tooltipEl?.getBoundingClientRect() ?? null;\n const pos = computeTooltipPosition(rect, tooltipRect, event.clientX + 10, event.clientY - 10, 10);\n this.tooltipPosition.set(pos);\n });\n }\n\n private hideTooltip() {\n this.tooltipVisible.set(false);\n }\n\n ngOnDestroy(): void {\n this.directionSub?.unsubscribe();\n this.svg?.remove();\n if (this._tooltipRafId) cancelAnimationFrame(this._tooltipRafId);\n }\n\n private drawAxisLabels(\n g: any,\n innerWidth: number,\n innerHeight: number,\n options: AXHeatmapChartOption,\n isRtl: boolean,\n xTickAreaHeight: number,\n ) {\n const xText = options.xAxisLabel?.trim();\n const yText = options.yAxisLabel?.trim();\n\n const labels = g.selectAll('.axis-labels').data([0]).join('g').attr('class', 'axis-labels');\n\n labels\n .selectAll('.axis-label-x')\n .data(xText ? [xText] : [])\n .join(\n (enter: any) => enter.append('text').attr('class', 'axis-label axis-label-x'),\n (update: any) => update,\n (exit: any) => exit.remove(),\n )\n .attr('x', innerWidth / 2)\n .attr('y', innerHeight + xTickAreaHeight + (xText ? this.X_AXIS_TITLE_GAP : 0))\n .attr('text-anchor', 'middle')\n .text((d: string) => d);\n\n const yX = isRtl ? innerWidth + 46 : -46;\n labels\n .selectAll('.axis-label-y')\n .data(yText ? [yText] : [])\n .join(\n (enter: any) => enter.append('text').attr('class', 'axis-label axis-label-y'),\n (update: any) => update,\n (exit: any) => exit.remove(),\n )\n .attr('transform', `translate(${yX}, ${innerHeight / 2}) rotate(-90)`)\n .attr('text-anchor', 'middle')\n .text((d: string) => d);\n }\n\n private getHeatmapXTickFontSize(innerWidth: number, itemCount: number): number {\n const baseSize = Math.round(innerWidth / 50);\n let adjustedSize = baseSize;\n if (itemCount > this.VERY_MANY_ITEMS_THRESHOLD) {\n adjustedSize = Math.round(baseSize * 0.7);\n } else if (itemCount > this.MANY_ITEMS_THRESHOLD) {\n adjustedSize = Math.round(baseSize * 0.85);\n }\n return Math.max(this.MIN_FONT_SIZE_X_AXIS, Math.min(this.MAX_FONT_SIZE_X_AXIS, adjustedSize));\n }\n\n private getHeatmapXTickPlan(xKeys: string[]): { tickXKeys: string[]; formatXTick: (d: string) => string } {\n const n = xKeys.length;\n const maxLabelLength = n > this.MANY_ITEMS_THRESHOLD ? 10 : this.MAX_LABEL_LENGTH;\n let tickXKeys = xKeys;\n if (n > this.VERY_MANY_ITEMS_THRESHOLD) {\n tickXKeys = xKeys.filter((_, i) => i % 5 === 0);\n } else if (n > this.MANY_ITEMS_THRESHOLD) {\n tickXKeys = xKeys.filter((_, i) => i % 2 === 0);\n }\n const formatXTick = (d: string) => this.truncateHeatmapLabel(d, maxLabelLength);\n return { tickXKeys, formatXTick };\n }\n\n private truncateHeatmapLabel(label: string, maxLength: number): string {\n if (label.length <= maxLength) return label;\n if (maxLength <= 1) return '…';\n return `${label.substring(0, maxLength - 1)}…`;\n }\n\n private shouldRotateHeatmapXLabels(\n rotateOption: boolean | 'auto' | undefined,\n estimatedLabelWidth: number,\n step: number,\n domainCount: number,\n ): boolean {\n if (rotateOption === true) return true;\n if (rotateOption === false) return false;\n if (domainCount === 0) return false;\n if (domainCount <= this.SMALL_DATASET_THRESHOLD) {\n return estimatedLabelWidth > step * this.ROTATION_TOLERANCE_SMALL_DATASET;\n }\n return estimatedLabelWidth > step;\n }\n\n private styleHeatmapXAxisTicks(g: any, fontSize: number, rotated: boolean): void {\n const texts = g\n .select('.x-axis')\n .selectAll('.tick text')\n .style('font-size', `${fontSize}px`)\n .style('font-weight', '400');\n\n if (rotated) {\n texts.attr('transform', 'rotate(-45)').style('text-anchor', 'end').attr('dx', '-0.8em').attr('dy', '0.15em');\n } else {\n texts.attr('transform', null).style('text-anchor', 'middle').attr('dx', null).attr('dy', '0.71em');\n }\n }\n\n // RTL is tracked via AXPlatform.directionChange\n}\n","<div class=\"ax-heatmap-chart-container\" role=\"img\" #chartContainer>\n @if (data()?.length === 0) {\n <div class=\"ax-heatmap-no-data\">\n <i [class]=\"effectiveOptions().messages?.noDataIcon\"></i>\n <p class=\"ax-heatmap-no-data-text\">{{ effectiveOptions().messages?.noData }}</p>\n </div>\n }\n</div>\n\n<ax-chart-tooltip [data]=\"tooltipData()\" [position]=\"tooltipPosition()\" [visible]=\"tooltipVisible()\">\n</ax-chart-tooltip>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAGO,MAAM,2BAA2B,GAAyB;AAC/D,IAAA,MAAM,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;AACpD,IAAA,KAAK,EAAE,sCAAsC;AAC7C,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,YAAY,EAAE,CAAC;AACf,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,SAAS,EAAE,IAAI;AACf,IAAA,iBAAiB,EAAE,MAAM;AACzB,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,iBAAiB,EAAE,GAAG;AACtB,IAAA,eAAe,EAAE,WAAW;AAC5B,IAAA,QAAQ,EAAE;AACR,QAAA,MAAM,EAAE,mBAAmB;AAC3B,QAAA,UAAU,EAAE,oDAAoD;AAChE,QAAA,UAAU,EAAE,oBAAoB;AACjC,KAAA;;MAGU,uBAAuB,GAAG,IAAI,cAAc,CAAuB,yBAAyB,EAAE;AACzG,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,MAAM,2BAA2B;AAC3C,CAAA;;ACMK,MAAO,uBAAwB,SAAQ,gBAAgB,CAAA;;AAEnD,IAAA,OAAgB,aAAa,GAAG,GAAG;;IAG1B,gBAAgB,GAAG,IAAI;IACvB,gCAAgC,GAAG,GAAG;IACtC,uBAAuB,GAAG,CAAC;IAC3B,oBAAoB,GAAG,EAAE;IACzB,yBAAyB,GAAG,EAAE;IAC9B,gBAAgB,GAAG,EAAE;IACrB,iBAAiB,GAAG,CAAC;IACrB,gBAAgB,GAAG,EAAE;IACrB,oBAAoB,GAAG,CAAC;IACxB,oBAAoB,GAAG,EAAE;;AAGzB,IA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AA,EAAA,CAAA,6gDAAA,CAAA,EAAA;iVA8BgC,gBAAgB,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE1DjG;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"acorex-charts-heatmap-chart.mjs","sources":["../../../../packages/charts/heatmap-chart/src/lib/heatmap-chart.config.ts","../../../../packages/charts/heatmap-chart/src/lib/heatmap-chart.component.ts","../../../../packages/charts/heatmap-chart/src/lib/heatmap-chart.component.html","../../../../packages/charts/heatmap-chart/src/acorex-charts-heatmap-chart.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { AXHeatmapChartOption } from './heatmap-chart.type';\n\nexport const AXHeatmapChartDefaultConfig: AXHeatmapChartOption = {\n margin: { top: 30, right: 30, bottom: 60, left: 60 },\n color: 'rgb(var(--ax-sys-color-primary-500))',\n cellPadding: 0.05,\n borderRadius: 2,\n showXAxis: true,\n showYAxis: true,\n rotateXAxisLabels: 'auto',\n showTooltip: true,\n animationDuration: 800,\n animationEasing: 'cubic-out',\n messages: {\n noData: 'No data available',\n noDataHelp: 'Provide X, Y, and Value data to render the heatmap',\n noDataIcon: 'fa-light fa-grid-2',\n },\n};\n\nexport const AX_HEATMAP_CHART_CONFIG = new InjectionToken<AXHeatmapChartOption>('AX_HEATMAP_CHART_CONFIG', {\n providedIn: 'root',\n factory: () => AXHeatmapChartDefaultConfig,\n});\n","import { AXChartComponent, computeTooltipPosition, getEasingFunction, resolveCssColorInContext } from '@acorex/charts';\nimport { AXChartTooltipComponent, AXChartTooltipData } from '@acorex/charts/chart-tooltip';\nimport { AXPlatform } from '@acorex/core/platform';\nimport {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n ElementRef,\n inject,\n input,\n OnDestroy,\n output,\n signal,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { map, Subscription } from 'rxjs';\nimport { AX_HEATMAP_CHART_CONFIG } from './heatmap-chart.config';\nimport { AXHeatmapChartOption, AXHeatmapData } from './heatmap-chart.type';\n\n@Component({\n selector: 'ax-heatmap-chart',\n templateUrl: './heatmap-chart.component.html',\n styleUrls: ['./heatmap-chart.component.css'],\n encapsulation: ViewEncapsulation.None,\n imports: [AXChartTooltipComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AXHeatmapChartComponent extends AXChartComponent implements OnDestroy {\n /** Fixed `viewBox` side; chart scales with CSS `width` / `height` on the host container. */\n private static readonly VIEW_BOX_SIZE = 400;\n\n // X-axis layout (aligned with bar-chart heuristics)\n private readonly CHAR_WIDTH_RATIO = 0.65;\n private readonly ROTATION_TOLERANCE_SMALL_DATASET = 1.4;\n private readonly SMALL_DATASET_THRESHOLD = 6;\n private readonly MANY_ITEMS_THRESHOLD = 20;\n private readonly VERY_MANY_ITEMS_THRESHOLD = 50;\n private readonly MAX_LABEL_LENGTH = 20;\n private readonly TICK_AREA_PADDING = 6;\n private readonly X_AXIS_TITLE_GAP = 10;\n private readonly X_AXIS_TITLE_FONT_SIZE = 14;\n private readonly MIN_FONT_SIZE_X_AXIS = 8;\n private readonly MAX_FONT_SIZE_X_AXIS = 14;\n\n // Inject config at the top level\n private readonly defaultConfig = inject(AX_HEATMAP_CHART_CONFIG);\n\n // Inputs\n data = input<AXHeatmapData[]>([]);\n options = input<AXHeatmapChartOption>({});\n\n // Outputs\n /** Emitted when a heatmap cell is clicked */\n cellClick = output<AXHeatmapData>();\n\n // View Child\n private readonly containerRef = viewChild.required<ElementRef<HTMLDivElement>>('chartContainer');\n\n // Internal State\n private svg: any;\n protected d3: any;\n private _d3Ready = signal(false);\n private platformService = inject(AXPlatform);\n protected isRtl = signal(this.platformService.isRtl());\n private directionSub?: Subscription;\n\n // Tooltip State\n protected tooltipVisible = signal(false);\n protected tooltipPosition = signal({ x: 0, y: 0 });\n protected tooltipData = signal<AXChartTooltipData>({ title: '', value: '' });\n private _tooltipRafId: number | null = null;\n\n // Computed options (referencing the already injected defaultConfig)\n protected effectiveOptions = computed(() => ({\n ...this.defaultConfig,\n ...this.options(),\n }));\n\n constructor() {\n super();\n\n afterNextRender(() => {\n this.init();\n this.directionSub = this.platformService.directionChange.pipe(map((i) => i.data === 'rtl')).subscribe((isRtl) => {\n this.isRtl.set(isRtl);\n if (this._d3Ready()) {\n this.renderChart();\n }\n });\n });\n\n // Reactive render when data, options, or D3 readiness change\n effect(() => {\n this.data();\n this.effectiveOptions();\n if (this._d3Ready()) {\n this.renderChart();\n }\n });\n }\n\n private async init() {\n try {\n this.d3 = await import('d3');\n\n this._d3Ready.set(true);\n } catch (err) {\n console.error('Heatmap: Initialization failed', err);\n }\n }\n\n public updateChart(): void {\n this.renderChart();\n }\n\n private renderChart() {\n const container = this.containerRef().nativeElement;\n const data = this.data() || [];\n\n // Clear SVG if data is empty\n if (data.length === 0) {\n if (this.svg) this.svg.remove();\n this.svg = null;\n return;\n }\n\n const options = this.effectiveOptions();\n const width = AXHeatmapChartComponent.VIEW_BOX_SIZE;\n const height = AXHeatmapChartComponent.VIEW_BOX_SIZE;\n const isRtl = this.isRtl();\n const baseMargin = options.margin || { top: 20, right: 20, bottom: 40, left: 40 };\n // When rendering RTL, the Y axis is on the right; swap side margins so tick labels\n // have the same breathing room they get on the left in LTR.\n let margin = isRtl\n ? { top: baseMargin.top, right: baseMargin.left, bottom: baseMargin.bottom, left: baseMargin.right }\n : { ...baseMargin };\n\n const xKeys = Array.from(new Set(data.map((d) => d.x.toString())));\n const yKeys = Array.from(new Set(data.map((d) => d.y.toString())));\n\n let innerWidth = width - margin.left - margin.right;\n const cellPad = options.cellPadding ?? 0;\n const xScaleProbe = this.d3\n .scaleBand()\n .domain(xKeys)\n .range(isRtl ? [innerWidth, 0] : [0, innerWidth])\n .padding(cellPad);\n\n const xTickFontSize = this.getHeatmapXTickFontSize(innerWidth, xKeys.length);\n const { tickXKeys, formatXTick } = this.getHeatmapXTickPlan(xKeys);\n const longestXLabel = xKeys.reduce((acc, k) => {\n const t = formatXTick(k);\n return t.length > acc.length ? t : acc;\n }, '');\n const estimatedLabelWidth = longestXLabel.length * xTickFontSize * this.CHAR_WIDTH_RATIO;\n const step = xScaleProbe.step();\n const rotateX = this.shouldRotateHeatmapXLabels(options.rotateXAxisLabels, estimatedLabelWidth, step, xKeys.length);\n\n const tickAreaHeight = rotateX\n ? estimatedLabelWidth * Math.SQRT1_2 + xTickFontSize * Math.SQRT1_2 + this.TICK_AREA_PADDING\n : xTickFontSize + this.TICK_AREA_PADDING + 2;\n\n const xAxisTitleReserve = options.xAxisLabel?.trim() ? this.X_AXIS_TITLE_GAP + 16 : 0;\n margin = { ...margin, bottom: Math.max(margin.bottom, tickAreaHeight + xAxisTitleReserve) };\n\n innerWidth = width - margin.left - margin.right;\n const innerHeight = Math.max(1, height - margin.top - margin.bottom);\n\n // Create/Select SVG root\n if (!this.svg) {\n this.svg = this.d3\n .select(container)\n .append('svg')\n .attr('width', '100%')\n .attr('height', '100%')\n .attr('preserveAspectRatio', 'xMidYMid meet')\n .style('display', 'block');\n this.svg.append('g').attr('class', 'chart-group');\n }\n\n this.svg.attr('viewBox', `0 0 ${width} ${height}`);\n const g = this.svg.select('.chart-group').attr('transform', `translate(${margin.left},${margin.top})`);\n\n // --- Scales ---\n const xScale = this.d3\n .scaleBand()\n .domain(xKeys)\n .range(isRtl ? [innerWidth, 0] : [0, innerWidth])\n .padding(cellPad);\n const yScale = this.d3.scaleBand().domain(yKeys).range([innerHeight, 0]).padding(cellPad);\n\n const valueExtent = this.d3.extent(data, (d: any) => d.value) as [number, number];\n const minValue = Number.isFinite(valueExtent[0]) ? valueExtent[0] : 0;\n const maxValue = Number.isFinite(valueExtent[1]) ? valueExtent[1] : minValue + 1;\n const palette = options.colors?.filter(Boolean) ?? [];\n const baseColor = options.color ?? 'rgb(99, 102, 241)';\n const rangeMin = options.valueRange?.min ?? minValue;\n const rangeMax = options.valueRange?.max ?? maxValue;\n\n const resolvedColorCache = new Map<string, string>();\n const resolvePaletteColor = (c: string): string => {\n const hit = resolvedColorCache.get(c);\n if (hit !== undefined) return hit;\n const out = resolveCssColorInContext(container, c);\n resolvedColorCache.set(c, out);\n return out;\n };\n const resolvedBase = resolvePaletteColor(baseColor);\n\n const getCellColor = (d: AXHeatmapData): string => {\n // If a palette is provided, choose a stable \"random\" color per cell.\n if (palette.length > 0) {\n const key = `${d.x}-${d.y}`;\n const idx = this.hashStringToUint32(key) % palette.length;\n return resolvePaletteColor(palette[idx] ?? baseColor);\n }\n\n const span = rangeMax - rangeMin;\n const t = span === 0 ? 1 : (d.value - rangeMin) / span;\n const clamped = Math.max(0, Math.min(1, t));\n return this.applyIntensityToResolvedRgb(resolvedBase, clamped);\n };\n\n // --- Axes ---\n const xAxisBuilder = this.d3\n .axisBottom(xScale)\n .tickSize(0)\n .tickFormat((d: string | number) => formatXTick(String(d)));\n if (tickXKeys.length < xKeys.length) {\n xAxisBuilder.tickValues(tickXKeys);\n }\n\n this.drawAxis(g, 'x-axis', xAxisBuilder, 0, innerHeight, options.showXAxis, isRtl);\n g.select('.x-axis').attr('direction', 'ltr');\n this.styleHeatmapXAxisTicks(g, xTickFontSize, rotateX);\n\n if (isRtl) {\n this.drawAxis(g, 'y-axis', this.d3.axisRight(yScale).tickSize(0), innerWidth, 0, options.showYAxis, isRtl);\n } else {\n this.drawAxis(g, 'y-axis', this.d3.axisLeft(yScale).tickSize(0), 0, 0, options.showYAxis, isRtl);\n }\n this.drawAxisLabels(g, innerWidth, innerHeight, options, isRtl, tickAreaHeight);\n\n // --- Cells with Data Join ---\n const easing = getEasingFunction(this.d3, options.animationEasing);\n\n g.selectAll('.cell')\n .data(data, (d: any) => `${d.x}-${d.y}`)\n .join(\n (enter: any) => enter.append('rect').attr('class', 'cell').attr('opacity', 0).attr('fill', resolvedBase),\n (update: any) => update,\n (exit: any) => exit.transition().duration(200).attr('opacity', 0).remove(),\n )\n .on('mouseenter', (event: any, d: AXHeatmapData) => this.showTooltip(event, d, getCellColor(d)))\n .on('mousemove', (event: any) => this.updateTooltipPos(event))\n .on('click', (_event: any, d: AXHeatmapData) => this.cellClick.emit(d))\n .on('mouseleave', () => this.hideTooltip())\n .transition()\n .duration(options.animationDuration)\n .ease(easing)\n .attr('x', (d: any) => xScale(d.x.toString()))\n .attr('y', (d: any) => yScale(d.y.toString()))\n .attr('width', xScale.bandwidth())\n .attr('height', yScale.bandwidth())\n .attr('rx', options.borderRadius)\n .attr('ry', options.borderRadius)\n .attr('opacity', 1)\n .style('fill', (d: AXHeatmapData) => getCellColor(d));\n }\n\n private hashStringToUint32(input: string): number {\n // Simple, fast, deterministic hash (djb2 variant)\n let hash = 5381;\n for (let i = 0; i < input.length; i++) {\n hash = (hash * 33) ^ input.charCodeAt(i);\n }\n return hash >>> 0;\n }\n\n /** `resolvedRgb` must be a computed `rgb()` / `rgba()` string (e.g. from {@link resolveCssColorInContext}). */\n private applyIntensityToResolvedRgb(resolvedRgb: string, t: number): string {\n const clamped = Math.max(0, Math.min(1, t));\n const parsed = this.d3.color(resolvedRgb);\n if (!parsed) return resolvedRgb;\n const rgb = this.d3.rgb(parsed);\n const minOpacity = 0.12;\n const opacity = minOpacity + clamped * (1 - minOpacity);\n return `rgba(${Math.round(rgb.r)},${Math.round(rgb.g)},${Math.round(rgb.b)},${opacity})`;\n }\n\n private drawAxis(g: any, className: string, axisFn: any, x: number, y: number, visible = true, isRtl = false) {\n let axisG = g.select(`.${className}`);\n if (axisG.empty()) axisG = g.append('g').attr('class', className);\n\n axisG\n .attr('transform', `translate(${x},${y})`)\n .style('display', visible ? 'block' : 'none')\n .call(axisFn)\n .call((g: any) => g.select('.domain').remove());\n\n // Ensure tick labels don't overlap the plot in RTL.\n // `text-anchor` is logical (depends on `direction`), so we set both explicitly.\n axisG.attr('direction', isRtl ? 'rtl' : 'ltr');\n axisG\n .selectAll('.tick text')\n .style('fill', 'rgba(var(--ax-comp-heatmap-chart-labels-color), 0.7)')\n .style('font-weight', '400');\n if (className === 'y-axis') {\n axisG.selectAll('.tick text').attr('text-anchor', 'end');\n }\n\n axisG.selectAll('line, path').style('stroke', 'rgba(var(--ax-comp-heatmap-chart-axis-color), 0.2)');\n }\n\n private showTooltip(event: MouseEvent, item: AXHeatmapData, color: string) {\n if (!this.effectiveOptions().showTooltip) return;\n this.tooltipData.set({\n title: `${item.x} / ${item.y}`,\n value: item.label || item.value.toLocaleString(),\n color: color,\n });\n this.tooltipVisible.set(true);\n this.updateTooltipPos(event);\n }\n\n private updateTooltipPos(event: MouseEvent) {\n if (this._tooltipRafId) cancelAnimationFrame(this._tooltipRafId);\n this._tooltipRafId = requestAnimationFrame(() => {\n const containerEl = this.containerRef().nativeElement;\n const rect = containerEl.getBoundingClientRect();\n const tooltipEl = containerEl.querySelector('.chart-tooltip') as HTMLElement;\n const tooltipRect = tooltipEl?.getBoundingClientRect() ?? null;\n const pos = computeTooltipPosition(rect, tooltipRect, event.clientX + 10, event.clientY - 10, 10);\n this.tooltipPosition.set(pos);\n });\n }\n\n private hideTooltip() {\n this.tooltipVisible.set(false);\n }\n\n ngOnDestroy(): void {\n this.directionSub?.unsubscribe();\n this.svg?.remove();\n if (this._tooltipRafId) cancelAnimationFrame(this._tooltipRafId);\n }\n\n private drawAxisLabels(\n g: any,\n innerWidth: number,\n innerHeight: number,\n options: AXHeatmapChartOption,\n isRtl: boolean,\n xTickAreaHeight: number,\n ) {\n const xText = options.xAxisLabel?.trim();\n const yText = options.yAxisLabel?.trim();\n\n const labels = g.selectAll('.axis-labels').data([0]).join('g').attr('class', 'axis-labels');\n\n labels\n .selectAll('.ax-heatmap-chart-axis-label-x')\n .data(xText ? [xText] : [])\n .join(\n (enter: any) =>\n enter.append('text').attr('class', 'ax-heatmap-chart-axis-label ax-heatmap-chart-axis-label-x'),\n (update: any) => update,\n (exit: any) => exit.remove(),\n )\n .attr('x', innerWidth / 2)\n .attr('y', innerHeight + xTickAreaHeight + (xText ? this.X_AXIS_TITLE_GAP : 0))\n .attr('text-anchor', 'middle')\n .attr('direction', 'ltr')\n .style('font-size', `${this.X_AXIS_TITLE_FONT_SIZE}px`)\n .style('font-weight', '500')\n .style('fill', 'rgb(var(--ax-comp-heatmap-chart-axis-label-color))')\n .text((d: string) => d);\n\n const yX = isRtl ? innerWidth + 46 : -46;\n labels\n .selectAll('.ax-heatmap-chart-axis-label-y')\n .data(yText ? [yText] : [])\n .join(\n (enter: any) =>\n enter.append('text').attr('class', 'ax-heatmap-chart-axis-label ax-heatmap-chart-axis-label-y'),\n (update: any) => update,\n (exit: any) => exit.remove(),\n )\n .attr('transform', `translate(${yX}, ${innerHeight / 2}) rotate(-90)`)\n .attr('text-anchor', 'middle')\n .style('font-size', `${this.X_AXIS_TITLE_FONT_SIZE}px`)\n .style('font-weight', '500')\n .style('fill', 'rgb(var(--ax-comp-heatmap-chart-axis-label-color))')\n .text((d: string) => d);\n }\n\n private getHeatmapXTickFontSize(innerWidth: number, itemCount: number): number {\n const baseSize = Math.round(innerWidth / 50);\n let adjustedSize = baseSize;\n if (itemCount > this.VERY_MANY_ITEMS_THRESHOLD) {\n adjustedSize = Math.round(baseSize * 0.7);\n } else if (itemCount > this.MANY_ITEMS_THRESHOLD) {\n adjustedSize = Math.round(baseSize * 0.85);\n }\n return Math.max(this.MIN_FONT_SIZE_X_AXIS, Math.min(this.MAX_FONT_SIZE_X_AXIS, adjustedSize));\n }\n\n private getHeatmapXTickPlan(xKeys: string[]): { tickXKeys: string[]; formatXTick: (d: string) => string } {\n const n = xKeys.length;\n const maxLabelLength = n > this.MANY_ITEMS_THRESHOLD ? 10 : this.MAX_LABEL_LENGTH;\n let tickXKeys = xKeys;\n if (n > this.VERY_MANY_ITEMS_THRESHOLD) {\n tickXKeys = xKeys.filter((_, i) => i % 5 === 0);\n } else if (n > this.MANY_ITEMS_THRESHOLD) {\n tickXKeys = xKeys.filter((_, i) => i % 2 === 0);\n }\n const formatXTick = (d: string) => this.truncateHeatmapLabel(d, maxLabelLength);\n return { tickXKeys, formatXTick };\n }\n\n private truncateHeatmapLabel(label: string, maxLength: number): string {\n if (label.length <= maxLength) return label;\n if (maxLength <= 1) return '…';\n return `${label.substring(0, maxLength - 1)}…`;\n }\n\n private shouldRotateHeatmapXLabels(\n rotateOption: boolean | 'auto' | undefined,\n estimatedLabelWidth: number,\n step: number,\n domainCount: number,\n ): boolean {\n if (rotateOption === true) return true;\n if (rotateOption === false) return false;\n if (domainCount === 0) return false;\n if (domainCount <= this.SMALL_DATASET_THRESHOLD) {\n return estimatedLabelWidth > step * this.ROTATION_TOLERANCE_SMALL_DATASET;\n }\n return estimatedLabelWidth > step;\n }\n\n private styleHeatmapXAxisTicks(g: any, fontSize: number, rotated: boolean): void {\n const texts = g\n .select('.x-axis')\n .selectAll('.tick text')\n .style('font-size', `${fontSize}px`)\n .style('font-weight', '400')\n .style('fill', 'rgba(var(--ax-comp-heatmap-chart-labels-color), 0.7)')\n .attr('direction', 'ltr');\n\n if (rotated) {\n texts.attr('transform', 'rotate(-45)').style('text-anchor', 'end').attr('dx', '-0.8em').attr('dy', '0.15em');\n } else {\n texts.attr('transform', null).style('text-anchor', 'middle').attr('dx', null).attr('dy', '0.71em');\n }\n }\n\n // RTL is tracked via AXPlatform.directionChange\n}\n","<div class=\"ax-heatmap-chart-container\" role=\"img\" #chartContainer>\n <ax-chart-tooltip [data]=\"tooltipData()\" [position]=\"tooltipPosition()\" [visible]=\"tooltipVisible()\">\n </ax-chart-tooltip>\n @if (data()?.length === 0) {\n <div class=\"ax-heatmap-no-data\">\n <i [class]=\"effectiveOptions().messages?.noDataIcon\"></i>\n <p class=\"ax-heatmap-no-data-text\">{{ effectiveOptions().messages?.noData }}</p>\n </div>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAGO,MAAM,2BAA2B,GAAyB;AAC/D,IAAA,MAAM,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAA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AAA,SAAA,EAAA,gBAAA,EAAA,OAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAGtB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBARnC,SAAS;+BACE,kBAAkB,EAAA,aAAA,EAGb,iBAAiB,CAAC,IAAI,EAAA,OAAA,EAC5B,CAAC,uBAAuB,CAAC,EAAA,eAAA,EACjB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,+cAAA,EAAA,MAAA,EAAA,CAAA,s5CAAA,CAAA,EAAA;iVA+BgC,gBAAgB,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE3DjG;;AAEG;;;;"}
|
|
@@ -49,7 +49,7 @@ class AXHierarchyChartComponent extends AXChartComponent {
|
|
|
49
49
|
// Chart container reference
|
|
50
50
|
chartContainer = viewChild.required('chartContainer');
|
|
51
51
|
// Custom node template provided by the user
|
|
52
|
-
customNodeTemplate = contentChild('nodeTemplate', ...(ngDevMode ? [{ debugName: "customNodeTemplate" }] : []));
|
|
52
|
+
customNodeTemplate = contentChild('nodeTemplate', ...(ngDevMode ? [{ debugName: "customNodeTemplate" }] : /* istanbul ignore next */ []));
|
|
53
53
|
// Services
|
|
54
54
|
ngZone = inject(NgZone);
|
|
55
55
|
viewContainerRef = inject(ViewContainerRef);
|
|
@@ -57,16 +57,17 @@ class AXHierarchyChartComponent extends AXChartComponent {
|
|
|
57
57
|
// D3 instance
|
|
58
58
|
d3;
|
|
59
59
|
// Internal state signals
|
|
60
|
-
_expandedNodes = signal(new Map(), ...(ngDevMode ? [{ debugName: "_expandedNodes" }] : []));
|
|
61
|
-
_initialized = signal(false, ...(ngDevMode ? [{ debugName: "_initialized" }] : []));
|
|
62
|
-
_rendered = signal(false, ...(ngDevMode ? [{ debugName: "_rendered" }] : []));
|
|
63
|
-
_dimensions = signal({ width: 0, height: 0 }, ...(ngDevMode ? [{ debugName: "_dimensions" }] : []));
|
|
64
|
-
_nodeElements = signal(new Map(), ...(ngDevMode ? [{ debugName: "_nodeElements" }] : [])); // Store references to node elements
|
|
65
|
-
_chartData = signal(null, ...(ngDevMode ? [{ debugName: "_chartData" }] : [])); // Store the current chart data and layout
|
|
60
|
+
_expandedNodes = signal(new Map(), ...(ngDevMode ? [{ debugName: "_expandedNodes" }] : /* istanbul ignore next */ []));
|
|
61
|
+
_initialized = signal(false, ...(ngDevMode ? [{ debugName: "_initialized" }] : /* istanbul ignore next */ []));
|
|
62
|
+
_rendered = signal(false, ...(ngDevMode ? [{ debugName: "_rendered" }] : /* istanbul ignore next */ []));
|
|
63
|
+
_dimensions = signal({ width: 0, height: 0 }, ...(ngDevMode ? [{ debugName: "_dimensions" }] : /* istanbul ignore next */ []));
|
|
64
|
+
_nodeElements = signal(new Map(), ...(ngDevMode ? [{ debugName: "_nodeElements" }] : /* istanbul ignore next */ [])); // Store references to node elements
|
|
65
|
+
_chartData = signal(null, ...(ngDevMode ? [{ debugName: "_chartData" }] : /* istanbul ignore next */ [])); // Store the current chart data and layout
|
|
66
|
+
embeddedViews = [];
|
|
66
67
|
// Inputs
|
|
67
|
-
data = input([], ...(ngDevMode ? [{ debugName: "data" }] : []));
|
|
68
|
-
options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
69
|
-
nodeTemplate = input(null, ...(ngDevMode ? [{ debugName: "nodeTemplate" }] : []));
|
|
68
|
+
data = input([], ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
69
|
+
options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
70
|
+
nodeTemplate = input(null, ...(ngDevMode ? [{ debugName: "nodeTemplate" }] : /* istanbul ignore next */ []));
|
|
70
71
|
// Outputs
|
|
71
72
|
itemClick = output();
|
|
72
73
|
nodeToggle = output();
|
|
@@ -75,17 +76,17 @@ class AXHierarchyChartComponent extends AXChartComponent {
|
|
|
75
76
|
const data = this.data();
|
|
76
77
|
// Handle both single node and array formats
|
|
77
78
|
return Array.isArray(data) ? { id: 'root', children: data } : data;
|
|
78
|
-
}, ...(ngDevMode ? [{ debugName: "processedData" }] : []));
|
|
79
|
+
}, ...(ngDevMode ? [{ debugName: "processedData" }] : /* istanbul ignore next */ []));
|
|
79
80
|
// Check if custom template is available
|
|
80
81
|
hasCustomTemplate = computed(() => {
|
|
81
82
|
return Boolean(this.customNodeTemplate() || this.nodeTemplate());
|
|
82
|
-
}, ...(ngDevMode ? [{ debugName: "hasCustomTemplate" }] : []));
|
|
83
|
+
}, ...(ngDevMode ? [{ debugName: "hasCustomTemplate" }] : /* istanbul ignore next */ []));
|
|
83
84
|
effectiveOptions = computed(() => {
|
|
84
85
|
return {
|
|
85
86
|
...this.configToken,
|
|
86
87
|
...this.options(),
|
|
87
88
|
};
|
|
88
|
-
}, ...(ngDevMode ? [{ debugName: "effectiveOptions" }] : []));
|
|
89
|
+
}, ...(ngDevMode ? [{ debugName: "effectiveOptions" }] : /* istanbul ignore next */ []));
|
|
89
90
|
// Messages with defaults
|
|
90
91
|
effectiveMessages = computed(() => {
|
|
91
92
|
const defaultMessages = {
|
|
@@ -97,7 +98,7 @@ class AXHierarchyChartComponent extends AXChartComponent {
|
|
|
97
98
|
...defaultMessages,
|
|
98
99
|
...this.effectiveOptions().messages,
|
|
99
100
|
};
|
|
100
|
-
}, ...(ngDevMode ? [{ debugName: "effectiveMessages" }] : []));
|
|
101
|
+
}, ...(ngDevMode ? [{ debugName: "effectiveMessages" }] : /* istanbul ignore next */ []));
|
|
101
102
|
constructor() {
|
|
102
103
|
super();
|
|
103
104
|
// Dynamically load D3 and initialize the chart when the component is ready
|
|
@@ -259,14 +260,14 @@ class AXHierarchyChartComponent extends AXChartComponent {
|
|
|
259
260
|
maxY = Math.max(maxY, y);
|
|
260
261
|
});
|
|
261
262
|
// Calculate the center of the tree
|
|
262
|
-
const centerX = (minX + maxX) / 2;
|
|
263
|
-
const centerY = (minY + maxY) / 2;
|
|
263
|
+
const centerX = Number.isFinite(minX) && Number.isFinite(maxX) ? (minX + maxX) / 2 : 0;
|
|
264
|
+
const centerY = Number.isFinite(minY) && Number.isFinite(maxY) ? (minY + maxY) / 2 : 0;
|
|
264
265
|
// Create a group for the chart content with proper centering
|
|
265
266
|
const g = svg
|
|
266
267
|
.append('g')
|
|
267
268
|
.attr('transform', isHorizontal
|
|
268
269
|
? `translate(${margin.left}, ${height / 2 - centerX})`
|
|
269
|
-
: `translate(${width / 2}, ${margin.top})`);
|
|
270
|
+
: `translate(${width / 2 - centerX}, ${margin.top})`);
|
|
270
271
|
// Add zoom and pan behavior (replaces AXPanViewDirective)
|
|
271
272
|
const zoom = this.d3
|
|
272
273
|
.zoom()
|
|
@@ -277,7 +278,7 @@ class AXHierarchyChartComponent extends AXChartComponent {
|
|
|
277
278
|
// Apply zoom behavior to SVG
|
|
278
279
|
svg.call(zoom);
|
|
279
280
|
// Set initial transform to match the centering
|
|
280
|
-
const initialTransform = this.d3.zoomIdentity.translate(isHorizontal ? margin.left : width / 2, isHorizontal ? height / 2 - centerX : margin.top);
|
|
281
|
+
const initialTransform = this.d3.zoomIdentity.translate(isHorizontal ? margin.left : width / 2 - centerX, isHorizontal ? height / 2 - centerX : margin.top);
|
|
281
282
|
svg.call(zoom.transform, initialTransform);
|
|
282
283
|
// Draw links between nodes
|
|
283
284
|
const links = g
|
|
@@ -426,6 +427,7 @@ class AXHierarchyChartComponent extends AXChartComponent {
|
|
|
426
427
|
$implicit: node,
|
|
427
428
|
};
|
|
428
429
|
const viewRef = this.viewContainerRef.createEmbeddedView(templateToUse, context);
|
|
430
|
+
this.embeddedViews.push(viewRef);
|
|
429
431
|
viewRef.detectChanges();
|
|
430
432
|
// Append template contents to the div
|
|
431
433
|
const nodes = viewRef.rootNodes;
|
|
@@ -624,14 +626,20 @@ class AXHierarchyChartComponent extends AXChartComponent {
|
|
|
624
626
|
* Clear existing chart
|
|
625
627
|
*/
|
|
626
628
|
cleanupChart() {
|
|
629
|
+
this.destroyEmbeddedViews();
|
|
627
630
|
const container = this.chartContainer()?.nativeElement;
|
|
628
631
|
if (!container)
|
|
629
632
|
return;
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
633
|
+
container.querySelectorAll('svg, .ax-hierarchy-chart-no-data-message').forEach((el) => el.remove());
|
|
634
|
+
}
|
|
635
|
+
ngOnDestroy() {
|
|
636
|
+
this.cleanupChart();
|
|
637
|
+
}
|
|
638
|
+
destroyEmbeddedViews() {
|
|
639
|
+
for (const view of this.embeddedViews) {
|
|
640
|
+
view.destroy();
|
|
634
641
|
}
|
|
642
|
+
this.embeddedViews = [];
|
|
635
643
|
}
|
|
636
644
|
updateChart() {
|
|
637
645
|
this.createChart();
|
|
@@ -669,8 +677,7 @@ class AXHierarchyChartComponent extends AXChartComponent {
|
|
|
669
677
|
* Shows a message when no data is available
|
|
670
678
|
*/
|
|
671
679
|
showNoDataMessage(containerElement) {
|
|
672
|
-
|
|
673
|
-
this.d3.select(containerElement).selectAll('*').remove();
|
|
680
|
+
this.cleanupChart();
|
|
674
681
|
const messageContainer = this.d3
|
|
675
682
|
.select(containerElement)
|
|
676
683
|
.append('div')
|
|
@@ -709,10 +716,10 @@ class AXHierarchyChartComponent extends AXChartComponent {
|
|
|
709
716
|
.style('opacity', '0.6')
|
|
710
717
|
.text(this.effectiveMessages().noDataHelp);
|
|
711
718
|
}
|
|
712
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
713
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.
|
|
719
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXHierarchyChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
720
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.9", type: AXHierarchyChartComponent, isStandalone: true, selector: "ax-hierarchy-chart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, nodeTemplate: { classPropertyName: "nodeTemplate", publicName: "nodeTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick", nodeToggle: "nodeToggle" }, queries: [{ propertyName: "customNodeTemplate", first: true, predicate: ["nodeTemplate"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "chartContainer", first: true, predicate: ["chartContainer"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-hierarchy-chart\" role=\"img\" #chartContainer></div>\n", styles: ["ax-hierarchy-chart{display:block;width:100%;height:100%;min-height:300px;--ax-comp-hierarchy-chart-node-color: var(--ax-sys-color-primary-500);--ax-comp-hierarchy-chart-node-stroke-color: var(--ax-sys-color-primary-400);--ax-comp-hierarchy-chart-link-color: var(--ax-sys-color-primary-400);--ax-comp-hierarchy-chart-text-color: var(--ax-sys-color-on-lightest-surface);--ax-comp-hierarchy-chart-bg-color: 0, 0, 0, 0;color:rgb(var(--ax-comp-hierarchy-chart-text-color));background-color:rgba(var(--ax-comp-hierarchy-chart-bg-color))}ax-hierarchy-chart .ax-hierarchy-chart{width:100%;height:100%;min-height:300px;position:relative;overflow:hidden}ax-hierarchy-chart .ax-hierarchy-chart svg{width:100%;height:100%;max-width:100%;max-height:100%;overflow:visible}ax-hierarchy-chart .ax-hierarchy-chart svg g:has(text){font-family:inherit}ax-hierarchy-chart .ax-hierarchy-chart-no-data-message{position:absolute;text-align:center;transform:translate(-50%,-50%);background-color:rgb(var(--ax-comp-hierarchy-chart-bg-color));padding:1.5rem;border-radius:.5rem;border:1px solid rgba(var(--ax-sys-color-surface));width:80%;max-width:300px}ax-hierarchy-chart .ax-hierarchy-chart-no-data-message .ax-hierarchy-chart-no-data-icon{opacity:.6;margin-bottom:.75rem}ax-hierarchy-chart .ax-hierarchy-chart-no-data-message .ax-hierarchy-chart-no-data-text{font-size:1rem;font-weight:600;margin-bottom:.5rem}ax-hierarchy-chart .ax-hierarchy-chart-no-data-message .ax-hierarchy-chart-no-data-help{font-size:.8rem;opacity:.6}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
714
721
|
}
|
|
715
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
722
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXHierarchyChartComponent, decorators: [{
|
|
716
723
|
type: Component,
|
|
717
724
|
args: [{ selector: 'ax-hierarchy-chart', standalone: true, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"ax-hierarchy-chart\" role=\"img\" #chartContainer></div>\n", styles: ["ax-hierarchy-chart{display:block;width:100%;height:100%;min-height:300px;--ax-comp-hierarchy-chart-node-color: var(--ax-sys-color-primary-500);--ax-comp-hierarchy-chart-node-stroke-color: var(--ax-sys-color-primary-400);--ax-comp-hierarchy-chart-link-color: var(--ax-sys-color-primary-400);--ax-comp-hierarchy-chart-text-color: var(--ax-sys-color-on-lightest-surface);--ax-comp-hierarchy-chart-bg-color: 0, 0, 0, 0;color:rgb(var(--ax-comp-hierarchy-chart-text-color));background-color:rgba(var(--ax-comp-hierarchy-chart-bg-color))}ax-hierarchy-chart .ax-hierarchy-chart{width:100%;height:100%;min-height:300px;position:relative;overflow:hidden}ax-hierarchy-chart .ax-hierarchy-chart svg{width:100%;height:100%;max-width:100%;max-height:100%;overflow:visible}ax-hierarchy-chart .ax-hierarchy-chart svg g:has(text){font-family:inherit}ax-hierarchy-chart .ax-hierarchy-chart-no-data-message{position:absolute;text-align:center;transform:translate(-50%,-50%);background-color:rgb(var(--ax-comp-hierarchy-chart-bg-color));padding:1.5rem;border-radius:.5rem;border:1px solid rgba(var(--ax-sys-color-surface));width:80%;max-width:300px}ax-hierarchy-chart .ax-hierarchy-chart-no-data-message .ax-hierarchy-chart-no-data-icon{opacity:.6;margin-bottom:.75rem}ax-hierarchy-chart .ax-hierarchy-chart-no-data-message .ax-hierarchy-chart-no-data-text{font-size:1rem;font-weight:600;margin-bottom:.5rem}ax-hierarchy-chart .ax-hierarchy-chart-no-data-message .ax-hierarchy-chart-no-data-help{font-size:.8rem;opacity:.6}\n"] }]
|
|
718
725
|
}], ctorParameters: () => [], propDecorators: { chartContainer: [{ type: i0.ViewChild, args: ['chartContainer', { isSignal: true }] }], customNodeTemplate: [{ type: i0.ContentChild, args: ['nodeTemplate', { isSignal: true }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], nodeTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "nodeTemplate", required: false }] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }], nodeToggle: [{ type: i0.Output, args: ["nodeToggle"] }] } });
|