@tectra-ng/charts 0.0.0-stage → 0.1.9

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tectra-ng-charts-pie.mjs","names":[],"sources":["../../../../packages/charts/pie/src/pie-layout.ts","../../../../packages/charts/pie/src/pie-legend.ts","../../../../packages/charts/pie/src/pie-center.directive.ts","../../../../packages/charts/pie/src/pie-chart.component.ts","../../../../packages/charts/pie/src/pie-chart.component.html"],"sourcesContent":["import { TxPieArc, TxPieFit } from './pie-chart.types';\n\nconst FULL = Math.PI * 2;\nconst round = (value: number) => Math.round(value * 100) / 100;\n\nexport function toRadians(degrees: number): number {\n return (degrees * Math.PI) / 180;\n}\n\nexport function polar(cx: number, cy: number, radius: number, angle: number): { x: number; y: number } {\n return { x: cx + radius * Math.sin(angle), y: cy - radius * Math.cos(angle) };\n}\n\nexport function pieAngles(values: readonly number[], startAngle = 0, endAngle = 360): { start: number; end: number; value: number; index: number }[] {\n const start = toRadians(startAngle);\n const span = toRadians(Math.min(360, Math.max(0, endAngle - startAngle)));\n const total = values.reduce((sum, value) => sum + (value > 0 ? value : 0), 0);\n let cursor = start;\n return values.map((raw, index) => {\n const value = raw > 0 ? raw : 0;\n const sweep = total ? (value / total) * span : 0;\n const arc = { start: cursor, end: cursor + sweep, value, index };\n cursor += sweep;\n return arc;\n });\n}\n\nexport function maxCornerRadius(inner: number, outer: number, sweep: number): number {\n const half = Math.min(Math.PI / 2, sweep / 2);\n const sin = Math.sin(half);\n const byThickness = inner > 0 ? (outer - inner) / 2 : outer / 2;\n const byOuter = (outer * sin) / (1 + sin);\n const byInner = inner > 0 && sin < 1 ? (inner * sin) / (1 - sin) : Infinity;\n return Math.max(0, Math.min(byThickness, byOuter, byInner));\n}\n\nexport function arcPath(cx: number, cy: number, inner: number, outer: number, start: number, end: number, corner = 0): string {\n const sweep = end - start;\n if (sweep <= 0 || outer <= 0) {\n return '';\n }\n if (sweep >= FULL - 1e-6) {\n const middle = start + Math.PI;\n return arcPath(cx, cy, inner, outer, start, middle) + arcPath(cx, cy, inner, outer, middle, start + FULL);\n }\n const radius = Math.min(Math.max(0, corner), maxCornerRadius(inner, outer, sweep));\n if (radius < 0.5) {\n const large = sweep > Math.PI ? 1 : 0;\n const a = polar(cx, cy, outer, start);\n const b = polar(cx, cy, outer, end);\n const head = `M${round(a.x)},${round(a.y)}A${round(outer)},${round(outer)} 0 ${large} 1 ${round(b.x)},${round(b.y)}`;\n if (inner <= 0) {\n return `${head}L${round(cx)},${round(cy)}Z`;\n }\n const c = polar(cx, cy, inner, end);\n const d = polar(cx, cy, inner, start);\n return `${head}L${round(c.x)},${round(c.y)}A${round(inner)},${round(inner)} 0 ${large} 0 ${round(d.x)},${round(d.y)}Z`;\n }\n const r = round(radius);\n const outerShift = Math.asin(radius / (outer - radius));\n const outerReach = Math.sqrt((outer - radius) ** 2 - radius ** 2);\n const p1 = polar(cx, cy, outerReach, start);\n const p2 = polar(cx, cy, outer, start + outerShift);\n const p3 = polar(cx, cy, outer, end - outerShift);\n const p4 = polar(cx, cy, outerReach, end);\n const outerLarge = end - start - outerShift * 2 > Math.PI ? 1 : 0;\n const head =\n `M${round(p1.x)},${round(p1.y)}A${r},${r} 0 0 1 ${round(p2.x)},${round(p2.y)}` +\n `A${round(outer)},${round(outer)} 0 ${outerLarge} 1 ${round(p3.x)},${round(p3.y)}` +\n `A${r},${r} 0 0 1 ${round(p4.x)},${round(p4.y)}`;\n if (inner <= 0) {\n return `${head}L${round(cx)},${round(cy)}Z`;\n }\n const innerShift = Math.asin(radius / (inner + radius));\n const innerReach = Math.sqrt((inner + radius) ** 2 - radius ** 2);\n const p5 = polar(cx, cy, innerReach, end);\n const p6 = polar(cx, cy, inner, end - innerShift);\n const p7 = polar(cx, cy, inner, start + innerShift);\n const p8 = polar(cx, cy, innerReach, start);\n const innerLarge = end - start - innerShift * 2 > Math.PI ? 1 : 0;\n return (\n `${head}L${round(p5.x)},${round(p5.y)}A${r},${r} 0 0 1 ${round(p6.x)},${round(p6.y)}` +\n `A${round(inner)},${round(inner)} 0 ${innerLarge} 0 ${round(p7.x)},${round(p7.y)}` +\n `A${r},${r} 0 0 1 ${round(p8.x)},${round(p8.y)}Z`\n );\n}\n\nexport function arcBounds(start: number, end: number): { minX: number; maxX: number; minY: number; maxY: number } {\n const points = [polar(0, 0, 1, start), polar(0, 0, 1, end), { x: 0, y: 0 }];\n for (let quarter = Math.ceil(start / (Math.PI / 2)); quarter * (Math.PI / 2) <= end; quarter++) {\n points.push(polar(0, 0, 1, quarter * (Math.PI / 2)));\n }\n return {\n minX: Math.min(...points.map((point) => point.x)),\n maxX: Math.max(...points.map((point) => point.x)),\n minY: Math.min(...points.map((point) => point.y)),\n maxY: Math.max(...points.map((point) => point.y)),\n };\n}\n\nexport function fitPie(width: number, height: number, startAngle = 0, endAngle = 360, padding = 4): TxPieFit {\n const start = toRadians(startAngle);\n const end = toRadians(Math.max(startAngle, Math.min(startAngle + 360, endAngle)));\n const bounds = arcBounds(start, end);\n const boxWidth = bounds.maxX - bounds.minX || 1;\n const boxHeight = bounds.maxY - bounds.minY || 1;\n const radius = Math.max(0, Math.min((width - padding * 2) / boxWidth, (height - padding * 2) / boxHeight));\n return {\n cx: width / 2 - ((bounds.minX + bounds.maxX) / 2) * radius,\n cy: height / 2 - ((bounds.minY + bounds.maxY) / 2) * radius,\n radius,\n };\n}\n\nexport function pieArcs(\n values: readonly number[],\n options: { width: number; height: number; startAngle?: number; endAngle?: number; donutSize?: number; padding?: number; cornerRadius?: number },\n): { fit: TxPieFit; inner: number; arcs: TxPieArc[] } {\n const fit = fitPie(options.width, options.height, options.startAngle ?? 0, options.endAngle ?? 360, options.padding ?? 4);\n const inner = fit.radius * Math.min(0.95, Math.max(0, options.donutSize ?? 0));\n const total = values.reduce((sum, value) => sum + (value > 0 ? value : 0), 0);\n const arcs = pieAngles(values, options.startAngle ?? 0, options.endAngle ?? 360).map((angle) => {\n const middle = (angle.start + angle.end) / 2;\n const labelRadius = inner > 0 ? (inner + fit.radius) / 2 : fit.radius * 0.62;\n const label = polar(fit.cx, fit.cy, labelRadius, middle);\n return {\n index: angle.index,\n value: angle.value,\n percent: total ? (angle.value / total) * 100 : 0,\n start: angle.start,\n end: angle.end,\n path: arcPath(fit.cx, fit.cy, inner, fit.radius, angle.start, angle.end, options.cornerRadius ?? 0),\n labelX: round(label.x),\n labelY: round(label.y),\n middle,\n };\n });\n return { fit, inner, arcs };\n}\n\nexport function arcAt(arcs: readonly TxPieArc[], fit: TxPieFit, inner: number, x: number, y: number): number {\n const dx = x - fit.cx;\n const dy = y - fit.cy;\n const distance = Math.hypot(dx, dy);\n if (distance > fit.radius + 2 || distance < inner - 2) {\n return -1;\n }\n let angle = Math.atan2(dx, -dy);\n const first = arcs.find((arc) => arc.end > arc.start)?.start ?? 0;\n while (angle < first) angle += FULL;\n while (angle >= first + FULL) angle -= FULL;\n return arcs.find((arc) => arc.end > arc.start && angle >= arc.start && angle < arc.end)?.index ?? -1;\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { seriesColor } from '@tectra-ng/charts/core';\nimport { TxPieData, TxPieLegendItem } from './pie-chart.types';\n\nexport function pieLegend(data: TxPieData | null | undefined): TxPieLegendItem[] {\n if (!data) {\n return [];\n }\n const total = data.series.reduce((sum, value) => sum + (value > 0 ? value : 0), 0);\n return data.series.map((value, index) => ({\n label: data.labels[index] ?? '',\n value,\n percent: total ? (Math.max(0, value) / total) * 100 : 0,\n color: seriesColor(data.colors?.[index], index),\n }));\n}\n\n@Pipe({ name: 'txPieLegend' })\nexport class TxPieLegendPipe implements PipeTransform {\n transform(data: TxPieData | null | undefined): TxPieLegendItem[] {\n return pieLegend(data);\n }\n}\n","import { Directive, TemplateRef, inject } from '@angular/core';\nimport { TxPieCenterContext } from './pie-chart.types';\n\n@Directive({ selector: 'ng-template[txPieCenter]' })\nexport class TxPieCenter {\n readonly template = inject<TemplateRef<TxPieCenterContext>>(TemplateRef);\n\n static ngTemplateContextGuard(_directive: TxPieCenter, context: unknown): context is TxPieCenterContext {\n return !!context;\n }\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n afterNextRender,\n afterRenderEffect,\n ElementRef,\n booleanAttribute,\n computed,\n contentChild,\n inject,\n input,\n linkedSignal,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport {\n TX_CHART_LEGEND_ROW,\n TX_CHART_LEGEND_SIDE,\n TxChartFrame,\n TxChartHeight,\n TxChartLegendAlign,\n TxChartLegendItem,\n TxChartLegendPosition,\n TxChartLegendTemplate,\n TxChartLegendVariant,\n TxChartTooltipPlacement,\n TxChartPointerEvent,\n TxChartTooltipData,\n TxChartTooltipFormatter,\n TxChartTooltipTemplate,\n TxChartValueFormat,\n chartHeightValue,\n chartNumberFormatter,\n chartSummary,\n injectChartEntrance,\n numberFormat,\n parseRatio,\n readTokenNumber,\n seriesColor,\n textWidth,\n toggleKey,\n} from '@tectra-ng/charts/core';\nimport { TxPassThrough, TxPassThroughOptions, injectPassThrough, injectUnstyled } from '@tectra-ng/core/config';\nimport { TxLocaleService, injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraChartTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { TxPieCenter } from './pie-center.directive';\nimport { TxPieCenterData, TxPieChartPart, TxPieData, TxPieSegmentEvent, TxPieSegmentToggle, TxPieTotalFormatter } from './pie-chart.types';\nimport { arcAt, pieArcs } from './pie-layout';\n\nconst MIN_LABEL_ANGLE = (10 * Math.PI) / 180;\nconst LEGEND_ITEM_WIDTH = 34;\nconst DEFAULT_SEGMENT_RADIUS = 4;\nconst STAT_ITEM_WIDTH = 116;\nconst STAT_ROW = 66;\n\n@Component({\n selector: 'tx-pie-chart',\n imports: [TxChartFrame, NgTemplateOutlet],\n templateUrl: './pie-chart.component.html',\n styleUrl: './pie-chart.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-pie-chart',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[class.tx-pie-chart--donut]': 'inner() > 0',\n '[class.tx-pie-chart--entering]': 'entrance.active()',\n '[class.tx-pie-chart--morph]': 'morph()',\n '[class.tx-pie-chart--hovering]': 'hovered() !== null',\n },\n})\nexport class TxPieChart {\n private locale = inject(TxLocaleService);\n private host = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly translations = injectTranslations();\n\n readonly pieData = input.required<TxPieData | null | undefined>();\n readonly chartWidth = input<number | string>(200);\n readonly chartHeight = input<TxChartHeight>(400);\n readonly showLegend = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly legendPosition = input<TxChartLegendPosition>('bottom');\n readonly legendAlign = input<TxChartLegendAlign>('center');\n readonly legendValues = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly legendVariant = input<TxChartLegendVariant>('dot');\n readonly showDataLabels = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly totalLabel = input('');\n readonly totalFormatter = input<TxPieTotalFormatter | null>(null);\n readonly tooltipFormatter = input<TxChartTooltipFormatter | null>(null);\n readonly showTooltip = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly valueFormat = input<TxChartValueFormat>('number');\n readonly donutSize = input<string | number>('65%');\n readonly segmentGap = input(2);\n readonly segmentRadius = input<number | undefined>(undefined);\n readonly startAngle = input(0);\n readonly endAngle = input(360);\n readonly loading = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly ariaLabel = input('');\n readonly dt = input<TectraDeepPartial<TectraChartTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxPieChartPart, TxPieChart> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly segmentClick = output<TxPieSegmentEvent>();\n readonly segmentToggle = output<TxPieSegmentToggle>();\n\n readonly centerTemplate = contentChild(TxPieCenter);\n readonly legendTemplate = contentChild(TxChartLegendTemplate);\n readonly tooltipTemplate = contentChild(TxChartTooltipTemplate);\n private readonly frame = viewChild(TxChartFrame);\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('pieChart', this, this.pt, this.ptOptions);\n readonly tokenStyle = computed(() => toStyleObject(this.dt(), '--tx-chart'));\n readonly hostStyle = computed(() => ({\n ...this.tokenStyle(),\n width: this.cssSize(this.chartWidth()),\n height: this.cssSize(this.chartHeight()),\n ...this.passThrough().root?.style,\n }));\n readonly entrance = injectChartEntrance();\n readonly morph = signal(false);\n\n readonly hidden = signal<ReadonlySet<string>>(new Set());\n readonly hovered = signal<number | null>(null);\n readonly tokenRadius = signal(DEFAULT_SEGMENT_RADIUS);\n readonly keyboard = signal(false);\n readonly fromLegend = signal(false);\n\n private readonly intl = computed(() => this.locale.locale().intl);\n readonly values = computed(() => this.pieData()?.series ?? []);\n readonly labels = computed(() => this.values().map((_, index) => this.pieData()?.labels[index] ?? ''));\n readonly keys = computed(() => this.labels().map((label, index) => `${index}:${label}`));\n readonly colors = computed(() => this.values().map((_, index) => seriesColor(this.pieData()?.colors?.[index], index)));\n readonly total = computed(() => this.values().reduce((sum, value, index) => sum + (value > 0 && !this.hidden().has(this.keys()[index]) ? value : 0), 0));\n readonly isEmpty = computed(() => !this.values().length || this.values().every((value) => !(value > 0)));\n readonly legendShown = computed(() => this.showLegend() && this.values().length > 0);\n readonly sideLegend = computed(() => this.legendPosition() === 'left' || this.legendPosition() === 'right');\n\n readonly size = linkedSignal(() => {\n const width = typeof this.chartWidth() === 'number' ? (this.chartWidth() as number) : 200;\n return { width: this.legendShown() && this.sideLegend() ? Math.max(80, width - TX_CHART_LEGEND_SIDE) : width, height: width };\n });\n\n readonly plotHeight = computed(() => {\n const width = this.size().width;\n const height = this.chartHeight();\n if (typeof height === 'string' && !/px$/.test(height.trim())) {\n return Math.round(width);\n }\n const available = chartHeightValue(height) - (this.legendShown() && !this.sideLegend() ? this.legendReserve() : 0);\n return Math.max(40, Math.round(Math.min(width, available)));\n });\n\n readonly legendReserve = computed(() => {\n const width = Math.max(1, this.size().width);\n const items = this.legendItems();\n if (this.legendVariant() === 'stat') {\n const perRow = Math.max(1, Math.floor(width / STAT_ITEM_WIDTH));\n return Math.ceil(items.length / perRow) * STAT_ROW + 7;\n }\n if (this.legendValues()) {\n return items.length * 22 + 8;\n }\n let rows = 1;\n let line = 0;\n for (const item of items) {\n const next = textWidth(item.label, 12.25) + LEGEND_ITEM_WIDTH + (this.legendVariant() === 'pill' ? 12 : 0);\n if (line && line + next > width) {\n rows += 1;\n line = 0;\n }\n line += next;\n }\n return rows * (TX_CHART_LEGEND_ROW - 7) + 7;\n });\n\n readonly inner = computed(() => Math.min(0.95, Math.max(0, parseRatio(this.donutSize(), 0.65))));\n\n readonly geometry = computed(() =>\n pieArcs(\n this.values().map((value, index) => (this.hidden().has(this.keys()[index]) ? 0 : value)),\n { width: this.size().width, height: this.plotHeight(), startAngle: this.startAngle(), endAngle: this.endAngle(), donutSize: this.inner(), padding: Math.max(8, this.segmentGap() + 2), cornerRadius: this.segmentRadius() ?? this.tokenRadius() },\n ),\n );\n\n readonly valueFormatter = computed(() => chartNumberFormatter(this.intl(), this.valueFormat()));\n readonly percentFormatter = computed(() => {\n const format = chartNumberFormatter(this.intl(), 'percent');\n return (value: number) => format(value);\n });\n\n readonly dataLabelFormatter = computed(() => {\n const format = numberFormat(this.intl(), { style: 'percent', minimumFractionDigits: 1, maximumFractionDigits: 1 });\n return (percent: number) => format.format(percent / 100);\n });\n\n readonly segments = computed(() => {\n const { arcs } = this.geometry();\n const labelFormat = this.dataLabelFormatter();\n return arcs\n .filter((arc) => arc.end > arc.start)\n .map((arc) => ({\n ...arc,\n key: this.keys()[arc.index],\n color: this.colors()[arc.index],\n ux: Math.round(Math.sin(arc.middle) * 1000) / 1000,\n uy: Math.round(-Math.cos(arc.middle) * 1000) / 1000,\n label: this.showDataLabels() && arc.end - arc.start >= MIN_LABEL_ANGLE ? labelFormat(arc.percent) : null,\n }));\n });\n\n readonly center = computed<TxPieCenterData | null>(() => {\n const index = this.hovered();\n const formatTotal = this.totalFormatter();\n const format = formatTotal ?? this.valueFormatter();\n if (index !== null && this.values()[index] !== undefined) {\n const raw = this.values()[index];\n return { label: this.labels()[index], value: format(raw), raw, total: this.total(), hovered: true, index, color: this.colors()[index] };\n }\n if (!this.totalLabel()) {\n return null;\n }\n return { label: this.totalLabel(), value: format(this.total()), raw: this.total(), total: this.total(), hovered: false, index: -1, color: null };\n });\n\n readonly centerBox = computed(() => {\n const { fit, inner } = this.geometry();\n const side = inner * Math.SQRT2 * 0.92;\n return { x: fit.cx - side / 2, y: fit.cy - side / 2, size: Math.max(0, side), cx: fit.cx, cy: fit.cy };\n });\n\n readonly centerFont = computed(() => {\n const inner = this.geometry().inner;\n return { name: Math.max(10, Math.min(12, inner * 0.17)), value: Math.max(13, Math.min(22, inner * 0.3)) };\n });\n\n readonly legendItems = computed<TxChartLegendItem[]>(() => {\n const total = this.total();\n const format = this.valueFormatter();\n const percent = this.percentFormatter();\n return this.values().map((value, index) => ({\n key: this.keys()[index],\n label: this.labels()[index],\n color: this.colors()[index],\n hidden: this.hidden().has(this.keys()[index]),\n ...(this.legendVariant() === 'stat'\n ? { value: format(value), caption: percent(total && !this.hidden().has(this.keys()[index]) ? Number(((Math.max(0, value) / total) * 100).toFixed(1)) : 0) }\n : this.legendValues()\n ? { value: format(value), percent: percent(total && !this.hidden().has(this.keys()[index]) ? Number(((Math.max(0, value) / total) * 100).toFixed(1)) : 0) }\n : {}),\n }));\n });\n\n readonly tooltip = computed<TxChartTooltipData | null>(() => {\n const index = this.hovered();\n if (index === null || !this.showTooltip() || this.isEmpty() || this.fromLegend() || this.legendVariant() === 'stat') return null;\n const raw = this.values()[index];\n const custom = this.tooltipFormatter();\n const value = custom ? custom(raw, { seriesIndex: index, dataPointIndex: index }) : this.valueFormatter()(raw);\n const { arcs, fit } = this.geometry();\n const arc = arcs[index];\n const sin = Math.sin(arc.middle);\n const cos = Math.cos(arc.middle);\n const placement: TxChartTooltipPlacement = Math.abs(sin) >= Math.SQRT1_2 ? (sin > 0 ? 'right' : 'left') : cos > 0 ? 'top' : 'bottom';\n const reach = fit.radius + 4;\n const share = this.percentFormatter()(Number(arc.percent.toFixed(1)));\n return {\n title: '',\n rows: [{ label: this.labels()[index], value, share, color: this.colors()[index], raw, seriesIndex: index, active: true }],\n index,\n x: fit.cx + sin * reach,\n y: fit.cy - cos * reach,\n placement,\n };\n });\n\n readonly summary = computed(() => {\n const t = this.translations();\n const values = this.values();\n const format = this.valueFormatter();\n const total = values.reduce((sum, value) => sum + (value > 0 ? value : 0), 0);\n const text = chartSummary(t, this.intl(), this.inner() > 0 ? t.chartDonut : t.chartPie, 1, values.length, null);\n const withTotal = `${text}, ${t.chartTotal.toLocaleLowerCase(this.intl())} ${format(total)}`;\n return this.ariaLabel() ? `${this.ariaLabel()}. ${withTotal}` : withTotal;\n });\n\n readonly dataTable = computed(() => {\n const t = this.translations();\n const format = this.valueFormatter();\n const percent = this.percentFormatter();\n const total = this.values().reduce((sum, value) => sum + (value > 0 ? value : 0), 0);\n return {\n columns: [\n { key: 'value', label: t.chartValue },\n { key: 'share', label: t.chartShare },\n ],\n rows: this.values().map((value, index) => ({\n label: this.labels()[index],\n cells: [format(value), percent(total ? Number(((Math.max(0, value) / total) * 100).toFixed(1)) : 0)],\n })),\n };\n });\n\n constructor() {\n afterNextRender(() => setTimeout(() => this.morph.set(true), 120));\n afterRenderEffect(() => {\n this.dt();\n const next = this.isUnstyled() ? 0 : readTokenNumber(this.host.nativeElement, '--tx-chart-pie-segment-radius', DEFAULT_SEGMENT_RADIUS);\n if (next !== this.tokenRadius()) {\n this.tokenRadius.set(next);\n }\n });\n }\n\n onPointer(event: TxChartPointerEvent): void {\n if (event.type === 'leave') {\n this.hovered.set(null);\n return;\n }\n const { arcs, fit, inner } = this.geometry();\n const index = arcAt(arcs, fit, inner, event.x, event.y);\n this.keyboard.set(false);\n this.fromLegend.set(false);\n this.hovered.set(index >= 0 ? index : null);\n if (event.type === 'click' && index >= 0) {\n this.segmentClick.emit({ index, label: this.labels()[index], value: this.values()[index], percent: arcs[index].percent });\n }\n }\n\n onNavigate(event: KeyboardEvent): void {\n if (event.key === 'Escape') {\n this.hovered.set(null);\n return;\n }\n const visible = this.segments().map((segment) => segment.index);\n if (!visible.length) return;\n const current = this.hovered();\n const at = current === null ? -1 : visible.indexOf(current);\n const forward = event.key === 'ArrowRight' || event.key === 'ArrowDown';\n const next =\n event.key === 'Home' ? 0 : event.key === 'End' ? visible.length - 1 : at < 0 ? (forward ? 0 : visible.length - 1) : (at + (forward ? 1 : -1) + visible.length) % visible.length;\n const index = visible[next];\n this.keyboard.set(true);\n this.fromLegend.set(false);\n this.hovered.set(index);\n const arc = this.geometry().arcs[index];\n this.frame()?.announce(`${this.labels()[index]}: ${this.valueFormatter()(this.values()[index])}, ${this.percentFormatter()(Number(arc.percent.toFixed(1)))}`);\n }\n\n onLegendToggle(key: string): void {\n const index = this.keys().indexOf(key);\n this.hidden.update((keys) => toggleKey(keys, key));\n this.hovered.set(null);\n this.segmentToggle.emit({ index, label: this.labels()[index] ?? '', hidden: this.hidden().has(key) });\n }\n\n onLegendHover(key: string | null): void {\n const index = key === null ? -1 : this.keys().indexOf(key);\n this.fromLegend.set(index >= 0);\n this.hovered.set(index >= 0 && !this.hidden().has(key ?? '') ? index : null);\n }\n\n private cssSize(value: number | string): string {\n return typeof value === 'number' ? `${value}px` : value;\n }\n}\n","<tx-chart-frame\n height=\"auto\"\n [plotHeight]=\"plotHeight()\"\n [(size)]=\"size\"\n [legendItems]=\"legendItems()\"\n [showLegend]=\"legendShown()\"\n [legendPosition]=\"legendPosition()\"\n [legendAlign]=\"legendAlign()\"\n [legendVariant]=\"legendVariant()\"\n [legendTemplate]=\"legendTemplate()?.template\"\n [empty]=\"isEmpty()\"\n [loading]=\"loading()\"\n emptyIcon=\"chart-pie\"\n [summary]=\"summary()\"\n [table]=\"dataTable()\"\n [tooltip]=\"tooltip()\"\n [tooltipTemplate]=\"tooltipTemplate()?.template\"\n [panelStyle]=\"tokenStyle()\"\n [parts]=\"passThrough()\"\n [styled]=\"!isUnstyled()\"\n (pointer)=\"onPointer($event)\"\n (navigate)=\"onNavigate($event)\"\n (legendToggled)=\"onLegendToggle($event)\"\n (legendHovered)=\"onLegendHover($event)\"\n (tooltipClosed)=\"hovered.set(null)\"\n>\n <svg:g class=\"tx-pie-chart__segments\" [style.transform-origin]=\"geometry().fit.cx + 'px ' + geometry().fit.cy + 'px'\">\n @for (segment of segments(); track segment.key) {\n <svg:path\n class=\"tx-pie-chart__segment\"\n [class.tx-pie-chart__segment--hovered]=\"hovered() === segment.index\"\n [class]=\"passThrough().segment?.class\"\n [style]=\"passThrough().segment?.style\"\n [attr.data-index]=\"segment.index\"\n [attr.d]=\"segment.path\"\n [style.--tx-pie-chart-color]=\"segment.color\"\n [style.stroke-width]=\"segmentGap()\"\n [style.--tx-pie-chart-ux]=\"segment.ux\"\n [style.--tx-pie-chart-uy]=\"segment.uy\"\n />\n }\n </svg:g>\n @if (showDataLabels()) {\n <svg:g class=\"tx-pie-chart__labels\">\n @for (segment of segments(); track segment.key) {\n @if (segment.label) {\n <svg:text\n class=\"tx-pie-chart__label\"\n [class]=\"passThrough().dataLabel?.class\"\n [style]=\"passThrough().dataLabel?.style\"\n text-anchor=\"middle\"\n dominant-baseline=\"central\"\n [attr.x]=\"segment.labelX\"\n [attr.y]=\"segment.labelY\"\n >\n {{ segment.label }}\n </svg:text>\n }\n }\n </svg:g>\n }\n @if (inner() > 0) {\n @if (centerTemplate(); as custom) {\n <svg:foreignObject\n class=\"tx-pie-chart__center\"\n [class]=\"passThrough().center?.class\"\n [style]=\"passThrough().center?.style\"\n [attr.x]=\"centerBox().x\"\n [attr.y]=\"centerBox().y\"\n [attr.width]=\"centerBox().size\"\n [attr.height]=\"centerBox().size\"\n >\n <xhtml:div class=\"tx-pie-chart__center-content\">\n <ng-container [ngTemplateOutlet]=\"custom.template\" [ngTemplateOutletContext]=\"{ $implicit: center() ?? { label: '', value: '', raw: total(), total: total(), hovered: false, index: -1, color: null } }\" />\n </xhtml:div>\n </svg:foreignObject>\n } @else if (center(); as data) {\n <svg:g class=\"tx-pie-chart__center\" [class]=\"passThrough().center?.class\" [style]=\"passThrough().center?.style\">\n <svg:text\n class=\"tx-pie-chart__center-value\"\n text-anchor=\"middle\"\n [attr.x]=\"centerBox().cx\"\n [attr.y]=\"centerBox().cy + centerFont().value * 0.32 - centerFont().name * 0.55\"\n [style.font-size.px]=\"centerFont().value\"\n >\n {{ data.value }}\n </svg:text>\n <svg:text\n class=\"tx-pie-chart__center-name\"\n text-anchor=\"middle\"\n dominant-baseline=\"hanging\"\n [attr.x]=\"centerBox().cx\"\n [attr.y]=\"centerBox().cy + centerFont().value * 0.32 - centerFont().name * 0.55 + 6\"\n [style.font-size.px]=\"centerFont().name\"\n >\n {{ data.label }}\n </svg:text>\n </svg:g>\n }\n }\n</tx-chart-frame>\n"],"mappings":";;;;;;;;AAEA,MAAM,OAAO,KAAK,KAAK;AACvB,MAAM,SAAS,UAAkB,KAAK,MAAM,QAAQ,GAAG,IAAI;AAE3D,SAAgB,UAAU,SAAe;CACvC,OAAQ,UAAU,KAAK,KAAM;AAC/B;AAEA,SAAgB,MAAM,IAAY,IAAY,QAAgB,OAAa;CACzE,OAAO;EAAE,GAAG,KAAK,SAAS,KAAK,IAAI,KAAK;EAAG,GAAG,KAAK,SAAS,KAAK,IAAI,KAAK;CAAC;AAC7E;AAEA,SAAgB,UAAU,QAA2B,aAAa,GAAG,WAAW,KAAG;CACjF,MAAM,QAAQ,UAAU,UAAU;CAClC,MAAM,OAAO,UAAU,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,WAAW,UAAU,CAAC,CAAC;CACxE,MAAM,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ACpB,sBAAsB,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAC3B,YAAY,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -0,0 +1,4 @@
1
+ const TECTRA_CHARTS_VERSION = "0.0.0";
2
+ export { TECTRA_CHARTS_VERSION };
3
+
4
+ //# sourceMappingURL=tectra-ng-charts.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tectra-ng-charts.mjs","names":[],"sources":["../../../../packages/charts/index.ts"],"sourcesContent":["export const TECTRA_CHARTS_VERSION = '0.0.0';\n"],"mappings":"AAAA,MAAa,wBAAwB"}
package/line/README.md ADDED
@@ -0,0 +1,75 @@
1
+ # Line Chart
2
+
3
+ `<tx-line-chart>` — a smooth area or line chart for trends over time, drawn as SVG by the component (no chart library). It renders on the server, takes its colours, fonts and sizes from the design tokens and follows the kit's locale.
4
+
5
+ ```ts
6
+ import { TxLineChart } from '@tectra-ng/charts/line';
7
+ ```
8
+
9
+ ```html
10
+ <tx-line-chart [series]="series" [categories]="months" [height]="320" ariaLabel="Visits by month" />
11
+ ```
12
+
13
+ ## Inputs
14
+ | Name | Description |
15
+ |---|---|
16
+ | series | `{ name, data, color? }[]`. `data` holds one number (or `null` for a gap) per category, or `{ x, y }` points. An empty list or only `null` values show "No data" |
17
+ | categories | X labels, one per value. Empty = the 12 month names of the active locale. With `xType="time"` these are dates |
18
+ | xType | `category` (labels at even steps), `time` (dates with real gaps, calendar ticks) or `linear` (numbers) |
19
+ | height | Height in px (450), or a CSS size such as `'100%'` of a parent with a definite height |
20
+ | curve | `smooth` (monotone, never overshoots), `straight` or `step` |
21
+ | area | Fills the area under each line with a fading gradient of its colour |
22
+ | stacked | Stacks the series on top of each other |
23
+ | stackType | `normal` or `100%` (each point as a share of the total; also turns stacking on) |
24
+ | markers | Draws a dot on every value (left out when the points are too dense) |
25
+ | showLegend | Shows the legend; a single series never has one |
26
+ | legendPosition | `top`, `bottom`, `left` or `right` |
27
+ | legendAlign | `start`, `center` or `end` for a top or bottom legend |
28
+ | legendVariant | Look of the legend: `line` (default), `dot`, `pill` or `stat` (each series' value under the pointer, or the last one, in large type; it replaces the tooltip) |
29
+ | showTooltip | Shows the tooltip on hover and keyboard focus |
30
+ | tooltipMode | `shared` (every series at the point) or `single` (the nearest series) |
31
+ | tooltipFormatter | `(value, { seriesIndex, dataPointIndex }) => string` for tooltip values; default — whole numbers in the locale |
32
+ | valueFormat | Value axis format: `number`, `integer`, `compact`, `percent` or a function |
33
+ | yScale | `linear` or `log` |
34
+ | yMin | Fixed bottom of the value axis |
35
+ | yMax | Fixed top of the value axis |
36
+ | xAxisTitle | Title under the x axis |
37
+ | yAxisTitle | Title beside the value axis |
38
+ | grid | Grid lines: `value`, `category`, `both` or `none` |
39
+ | xAxisPosition | Side of the horizontal axis: `bottom` or `top` |
40
+ | yAxisPosition | Side of the vertical axis: `left` or `right` |
41
+ | labelMode | X labels that do not fit: `auto`, `rotate` or `skip` |
42
+ | maxLabels | At most this many x labels (10) |
43
+ | decimation | Thins long series with the largest-triangle method before drawing |
44
+ | loading | Shows a skeleton of the same size |
45
+ | ariaLabel | What the chart shows; starts the summary read by screen readers |
46
+ | dt | Design tokens of this chart (`chart`) |
47
+ | pt | Classes and styles of the parts: `root`, `legend`, `legendItem`, `plot`, `svg`, `grid`, `axis`, `series`, `line`, `area`, `marker`, `crosshair`, `tooltip`, `empty`, `skeleton` |
48
+ | ptOptions | How `pt` merges with the global pass-through |
49
+ | unstyled | Removes the tectra styles and keeps the behaviour |
50
+
51
+ ## Outputs
52
+ | Name | Description |
53
+ |---|---|
54
+ | pointClick | A value was clicked: `seriesIndex`, `dataPointIndex`, `value`, `category` |
55
+ | seriesToggle | A legend item hid or showed a series: `seriesIndex`, `name`, `hidden` |
56
+
57
+ ## Slots
58
+ | Name | Description |
59
+ |---|---|
60
+ | txChartTooltip | `<ng-template txChartTooltip let-data>` — own tooltip content; `data` has `title` and `rows` (`label`, `value`, `color`, `raw`, `seriesIndex`) |
61
+ | txChartLegend | `<ng-template txChartLegend let-item>` — own legend item; `item` has `label`, `color`, `hidden` |
62
+
63
+ ## Keyboard
64
+ | Key | Action |
65
+ |---|---|
66
+ | Tab | Focuses the chart, then the legend items |
67
+ | ← / → | Previous / next value; the value is announced and the tooltip follows |
68
+ | ↑ / ↓ | Previous / next visible series |
69
+ | Home / End | First / last value |
70
+ | Escape | Closes the tooltip |
71
+ | ← / → in the legend | Moves between legend items; Enter or Space toggles the series |
72
+
73
+ ## Notes
74
+
75
+ On hover a vertical rule marks the nearest value, every series gets a ringed point on it, and the tooltip is pinned above the rule with an arrow (in `single` mode — above the point); stacked charts add the total. The server renders the chart at a fixed width with the same markup the browser hydrates; the real width is measured after hydration and the chart redraws inside the same box, so nothing on the page moves. New inputs redraw in place and the lines morph to the new values. Colours of hidden series stay with their series.
package/package.json CHANGED
@@ -1,6 +1,76 @@
1
1
  {
2
2
  "name": "@tectra-ng/charts",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.9",
4
+ "description": "Angular charts drawn as SVG with no chart library: line and area, column and bar, pie and donut on one core of scales, axes, legend, tooltip and accessibility. Server rendered, themed by design tokens, dark mode ready.",
5
+ "license": "MIT",
6
+ "homepage": "https://tectra-ng.com/components/line-chart",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/kulakovskyi/tectra-ng.git",
10
+ "directory": "packages/charts"
11
+ },
12
+ "bugs": "https://github.com/kulakovskyi/tectra-ng/issues",
13
+ "keywords": [
14
+ "tectra",
15
+ "angular",
16
+ "angular-charts",
17
+ "charts",
18
+ "chart",
19
+ "svg-charts",
20
+ "line-chart",
21
+ "area-chart",
22
+ "bar-chart",
23
+ "column-chart",
24
+ "pie-chart",
25
+ "donut-chart",
26
+ "data-visualization",
27
+ "dataviz",
28
+ "ssr",
29
+ "zero-dependency",
30
+ "signals"
31
+ ],
32
+ "peerDependencies": {
33
+ "@angular/cdk": "^22.0.0",
34
+ "@angular/common": "^22.0.0",
35
+ "@angular/core": "^22.0.0",
36
+ "@tectra-ng/core": "^0.1.9",
37
+ "@tectra-ng/icons": "^0.1.9",
38
+ "@tectra-ng/themes": "^0.1.9",
39
+ "@tectra-ng/ui": "^0.1.9"
40
+ },
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
44
+ "module": "fesm2022/tectra-ng-charts.mjs",
45
+ "typings": "types/tectra-ng-charts.d.ts",
46
+ "exports": {
47
+ "./package.json": {
48
+ "default": "./package.json"
49
+ },
50
+ ".": {
51
+ "types": "./types/tectra-ng-charts.d.ts",
52
+ "default": "./fesm2022/tectra-ng-charts.mjs"
53
+ },
54
+ "./column": {
55
+ "types": "./types/tectra-ng-charts-column.d.ts",
56
+ "default": "./fesm2022/tectra-ng-charts-column.mjs"
57
+ },
58
+ "./core": {
59
+ "types": "./types/tectra-ng-charts-core.d.ts",
60
+ "default": "./fesm2022/tectra-ng-charts-core.mjs"
61
+ },
62
+ "./line": {
63
+ "types": "./types/tectra-ng-charts-line.d.ts",
64
+ "default": "./fesm2022/tectra-ng-charts-line.mjs"
65
+ },
66
+ "./pie": {
67
+ "types": "./types/tectra-ng-charts-pie.d.ts",
68
+ "default": "./fesm2022/tectra-ng-charts-pie.mjs"
69
+ }
70
+ },
71
+ "sideEffects": false,
72
+ "type": "module",
73
+ "dependencies": {
74
+ "tslib": "^2.3.0"
75
+ }
6
76
  }
package/pie/README.md ADDED
@@ -0,0 +1,65 @@
1
+ # Pie Chart
2
+
3
+ `<tx-pie-chart>` — a donut or pie for parts of a whole: the total in the centre, the hovered segment there on hover, percent labels on the segments, a legend below or beside with values and shares. Drawn as SVG, rendered on the server and themed by the design tokens. The `txPieLegend` pipe and `pieLegend()` give the same rows and colours for your own legend.
4
+
5
+ ```ts
6
+ import { TxPieChart, TxPieLegendPipe } from '@tectra-ng/charts/pie';
7
+ ```
8
+
9
+ ```html
10
+ <tx-pie-chart [pieData]="{ series: [12, 5], labels: ['Active', 'Paused'] }" totalLabel="Total" />
11
+ ```
12
+
13
+ ## Inputs
14
+ | Name | Description |
15
+ |---|---|
16
+ | pieData | Required. `{ series, labels, colors? }` — values, one label per value and optional own colours. No values or only zeros show "No data" |
17
+ | chartWidth | Width: px (200) or a CSS size |
18
+ | chartHeight | Height: px (400) or a CSS size; the donut takes the width and the legend goes under it |
19
+ | showLegend | Shows the legend |
20
+ | legendPosition | `bottom` (default), `top`, `left` or `right` |
21
+ | legendAlign | `center` (default), `start` or `end` for a top or bottom legend |
22
+ | legendVariant | Look of the legend: `dot` (default), `line`, `pill` or `stat` (each value in large type with its share; it replaces the tooltip) |
23
+ | legendValues | Lists the value and the share of each segment in the legend |
24
+ | showDataLabels | Writes the share on each segment (one decimal); slices under 10° get none |
25
+ | totalLabel | Non-empty = the total is always in the centre with this caption |
26
+ | totalFormatter | `(value) => string` for the centre total and the hovered value |
27
+ | tooltipFormatter | `(value, { seriesIndex }) => string` for the tooltip value |
28
+ | showTooltip | Shows the tooltip on hover and keyboard focus |
29
+ | valueFormat | Format of values: `number`, `integer`, `compact`, `percent` or a function |
30
+ | donutSize | Size of the hole as a share of the radius (`'65%'`); `'0%'` draws a pie |
31
+ | segmentGap | Width in px of the card-coloured gap between segments (2) |
32
+ | segmentRadius | Rounding of the segment corners in px; default — the `chart.pie.segmentRadius` token (4px). It shrinks on narrow segments and thin rings so the shape never breaks; `0` keeps sharp corners |
33
+ | startAngle | Where the first segment starts, degrees clockwise from the top (0) |
34
+ | endAngle | Where the last one ends (360); `-90` to `90` is a half donut |
35
+ | loading | Shows a skeleton of the same size |
36
+ | ariaLabel | What the chart shows; starts the summary read by screen readers |
37
+ | dt | Design tokens of this chart (`chart`) |
38
+ | pt | Classes and styles of the parts: `root`, `legend`, `legendItem`, `plot`, `svg`, `segment`, `dataLabel`, `center`, `tooltip`, `empty`, `skeleton` |
39
+ | ptOptions | How `pt` merges with the global pass-through |
40
+ | unstyled | Removes the tectra styles and keeps the behaviour |
41
+
42
+ ## Outputs
43
+ | Name | Description |
44
+ |---|---|
45
+ | segmentClick | A segment was clicked: `index`, `label`, `value`, `percent` |
46
+ | segmentToggle | A legend item hid or showed a segment: `index`, `label`, `hidden` |
47
+
48
+ ## Slots
49
+ | Name | Description |
50
+ |---|---|
51
+ | txPieCenter | `<ng-template txPieCenter let-center>` — own centre content; `center` has `label`, `value`, `raw`, `total`, `hovered`, `index`, `color` |
52
+ | txChartTooltip | `<ng-template txChartTooltip let-data>` — own tooltip content |
53
+ | txChartLegend | `<ng-template txChartLegend let-item>` — own legend item (`label`, `color`, `hidden`, `value`, `percent`) |
54
+
55
+ ## Keyboard
56
+ | Key | Action |
57
+ |---|---|
58
+ | Tab | Focuses the chart, then the legend items |
59
+ | ← / → or ↑ / ↓ | Previous / next segment; announced with its value and share, the tooltip follows |
60
+ | Home / End | First / last segment |
61
+ | Escape | Closes the tooltip |
62
+
63
+ ## Notes
64
+
65
+ A hovered segment moves out a little, the others fade, the centre shows its value and name, and the tooltip sits at the segment's outer edge with an arrow, on the side the segment faces. `pieLegend(data)` / `data | txPieLegend` return `{ label, value, percent, color }` in series order; `percent` is 0–100 and not rounded, `color` is the CSS variable of the palette slot (it follows the theme). Segments turn in once when the chart appears and morph to new values on change; both are off with reduced motion.