@angx/ngx-chart-kit 0.0.0-stage → 0.1.0

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":"angx-ngx-chart-kit.mjs","names":[],"sources":["../../../../projects/angx/ngx-chart-kit/src/lib/chart-js-loader.ts","../../../../projects/angx/ngx-chart-kit/src/lib/chart-kit-palette.ts","../../../../projects/angx/ngx-chart-kit/src/lib/chart-kit-color.ts","../../../../projects/angx/ngx-chart-kit/src/lib/chart-kit-theme.ts","../../../../projects/angx/ngx-chart-kit/src/lib/chart-kit-table.ts","../../../../projects/angx/ngx-chart-kit/src/lib/chart-kit-config.ts","../../../../projects/angx/ngx-chart-kit/src/lib/ngx-chart-kit.component.ts"],"sourcesContent":["import type { ChartKitType } from './chart-kit.types';\n\n/**\n * Loads chart.js on first use, and registers only the pieces the requested\n * chart form needs.\n *\n * Two problems are solved here. The first is bundle size: chart.js is around\n * 200 kB unminified, and a static import would put all of it in whichever\n * chunk the consuming component lands in — typically the initial one. A\n * dynamic `import()` leaves it in a chunk of its own that is fetched the first\n * time a chart is actually drawn, so an application that renders no chart on\n * its landing route pays nothing for having the library installed.\n *\n * The second is tree shaking. `chart.js/auto` registers every controller,\n * scale, element and plugin, which is the single biggest reason chart.js\n * wrappers are large. Registering per form keeps a bar-chart-only application\n * from carrying the radar controller.\n *\n * The module promise and the set of registered forms are module-level, so the\n * cost is paid once per application rather than once per component instance.\n */\ntype ChartJsModule = typeof import('chart.js');\n\nlet modulePromise: Promise<ChartJsModule> | null = null;\nconst registeredForms = new Set<ChartKitType>();\n\n/** The chart.js exports each form needs registered. */\nfunction registrablesFor(module: ChartJsModule, type: ChartKitType): unknown[] {\n const shared = [module.Legend, module.Tooltip];\n\n switch (type) {\n case 'bar':\n case 'hbar':\n return [\n ...shared,\n module.BarController,\n module.BarElement,\n module.CategoryScale,\n module.LinearScale,\n ];\n\n case 'line':\n case 'area':\n return [\n ...shared,\n module.LineController,\n module.LineElement,\n module.PointElement,\n module.CategoryScale,\n module.LinearScale,\n // Only `area` fills, but line and area share a chart instance that can\n // be switched between them without a rebuild, so the filler plugin has\n // to be present for both.\n module.Filler,\n ];\n\n case 'pie':\n return [...shared, module.PieController, module.ArcElement];\n\n case 'doughnut':\n return [...shared, module.DoughnutController, module.ArcElement];\n\n case 'radar':\n return [\n ...shared,\n module.RadarController,\n module.LineElement,\n module.PointElement,\n module.RadialLinearScale,\n module.Filler,\n ];\n }\n}\n\n/**\n * Resolves to chart.js's `Chart` constructor with everything `type` needs\n * registered. Safe to call on every draw: the import is cached and\n * registration is skipped for a form already seen.\n */\nexport async function loadChartJs(type: ChartKitType): Promise<ChartJsModule['Chart']> {\n modulePromise ??= import('chart.js');\n const module = await modulePromise;\n\n if (!registeredForms.has(type)) {\n // `Chart.register` de-duplicates internally, so the overlap between forms\n // (the category scale, the legend) costs nothing.\n module.Chart.register(...(registrablesFor(module, type) as Parameters<\n typeof module.Chart.register\n >));\n registeredForms.add(type);\n }\n\n return module.Chart;\n}\n\n/**\n * Forgets the cached module and registrations. Exists for tests, which need\n * each case to start from \"chart.js has not been loaded yet\"; an application\n * has no reason to call it.\n */\nexport function resetChartJsLoaderForTesting(): void {\n modulePromise = null;\n registeredForms.clear();\n}\n","/**\n * The default categorical palette.\n *\n * Chosen from the Okabe–Ito colour-blind-safe set, with two deliberate\n * departures:\n *\n * - Okabe–Ito's black is dropped. It is invisible against a dark surface, and\n * this library is meant to be themed from CSS rather than assume a white\n * page.\n * - Okabe–Ito's `#F0E442` yellow is dropped. Its relative luminance is around\n * 0.79, so a 2px line or a small legend swatch in that colour falls below\n * 3:1 against white.\n *\n * That leaves six Okabe–Ito hues, extended with a violet from IBM's\n * colour-blind-safe palette and a neutral grey in the last slot, which reads\n * naturally as \"other\" when a chart needs more than seven series. Every entry\n * sits in the mid-luminance band (roughly 0.15–0.5), which is what lets the\n * same palette hold its contrast on a near-white and a near-black surface\n * without being swapped out.\n *\n * The order separates the pairs most easily confused under protanopia and\n * deuteranopia: blue and orange first, with sky blue held back to slot five so\n * it is never adjacent to the darker blue.\n */\nexport const CHART_KIT_PALETTE: readonly string[] = [\n '#0072b2', // blue\n '#e69f00', // orange\n '#009e73', // bluish green\n '#cc79a7', // reddish purple\n '#56b4e9', // sky blue\n '#d55e00', // vermillion\n '#785ef0', // violet\n '#7f7f7f', // neutral grey\n];\n\n/** CSS custom properties the library reads from its host element. */\nexport const CHART_KIT_CSS_PROPERTIES = {\n /** Whole palette as a comma-separated list, replacing the default. */\n palette: '--chart-kit-palette',\n /** Prefix for a single palette slot, 1-based: `--chart-kit-series-3`. */\n seriesPrefix: '--chart-kit-series-',\n /** Legend labels and tooltip titles. */\n text: '--chart-kit-text',\n /** Axis ticks. */\n muted: '--chart-kit-muted',\n /** Grid and axis lines. */\n grid: '--chart-kit-grid',\n /** Surface the chart sits on; fills the gaps between pie slices. */\n surface: '--chart-kit-surface',\n /** Tooltip background. */\n tooltipBackground: '--chart-kit-tooltip-bg',\n /** Tooltip text. */\n tooltipText: '--chart-kit-tooltip-text',\n /** Font stack for every label the chart draws. */\n font: '--chart-kit-font',\n} as const;\n","/**\n * Colour helpers used by the theme reader.\n *\n * Everything here is pure string work, because the colours a chart draws with\n * arrive as CSS text — either resolved by `getComputedStyle` (always an\n * `rgb()` / `rgba()` form) or straight from a custom property, which\n * `getComputedStyle` hands back as the author's raw token (`#0af`, `tomato`,\n * `oklch(...)`). Anything this module cannot parse is passed through\n * unchanged rather than guessed at.\n */\n\nconst HEX = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;\nconst RGB_FUNCTION = /^rgba?\\(([^)]*)\\)$/i;\n\n/**\n * Splits a comma-separated list of CSS values, ignoring commas inside\n * parentheses so `rgb(0, 118, 255), #e69f00` yields two entries rather than\n * four. Used for the `--chart-kit-palette` custom property.\n */\nexport function splitCssList(value: string): string[] {\n const parts: string[] = [];\n let depth = 0;\n let current = '';\n\n for (const character of value) {\n if (character === '(') {\n depth += 1;\n } else if (character === ')') {\n depth = Math.max(depth - 1, 0);\n }\n\n if (character === ',' && depth === 0) {\n parts.push(current);\n current = '';\n continue;\n }\n\n current += character;\n }\n\n parts.push(current);\n return parts.map((part) => part.trim()).filter((part) => part.length > 0);\n}\n\n/** Parses a colour to `[r, g, b, a]`, or `null` if the form is unrecognised. */\nfunction parseColor(color: string): [number, number, number, number] | null {\n const value = color.trim();\n\n if (HEX.test(value)) {\n const digits = value.slice(1);\n const expand = (text: string) =>\n text.length === 1 ? parseInt(text + text, 16) : parseInt(text, 16);\n const step = digits.length <= 4 ? 1 : 2;\n const channels: number[] = [];\n for (let index = 0; index < digits.length; index += step) {\n channels.push(expand(digits.slice(index, index + step)));\n }\n const [r = 0, g = 0, b = 0, a] = channels;\n return [r, g, b, a === undefined ? 1 : a / 255];\n }\n\n const functional = RGB_FUNCTION.exec(value);\n if (functional) {\n // Handles both the legacy `rgb(0, 0, 0)` and modern `rgb(0 0 0 / 50%)`\n // forms, which is what a computed style may contain.\n const [channels, alphaText] = functional[1].split('/');\n const numbers = channels\n .split(/[\\s,]+/)\n .map((part) => part.trim())\n .filter((part) => part.length > 0);\n if (numbers.length < 3) {\n return null;\n }\n const toChannel = (part: string) =>\n part.endsWith('%') ? (Number.parseFloat(part) / 100) * 255 : Number.parseFloat(part);\n const toAlpha = (part: string | undefined) => {\n if (part === undefined) {\n return 1;\n }\n const trimmed = part.trim();\n return trimmed.endsWith('%') ? Number.parseFloat(trimmed) / 100 : Number.parseFloat(trimmed);\n };\n const rgb = numbers.slice(0, 3).map(toChannel);\n const alpha = toAlpha(alphaText ?? numbers[3]);\n if (rgb.some((channel) => !Number.isFinite(channel)) || !Number.isFinite(alpha)) {\n return null;\n }\n return [rgb[0], rgb[1], rgb[2], alpha];\n }\n\n return null;\n}\n\n/**\n * Returns `color` at the given opacity.\n *\n * chart.js parses every colour it is handed with its own parser, so a\n * `color-mix()` expression — the obvious CSS answer — would reach it and be\n * dropped. Flattening the alpha here keeps what chart.js receives to plain\n * `rgba()`. A colour this module cannot parse is returned unchanged, so a chart\n * styled with `oklch()` draws in solid colour rather than not at all.\n */\nexport function withAlpha(color: string, alpha: number): string {\n const parsed = parseColor(color);\n if (!parsed) {\n return color;\n }\n const [r, g, b, existing] = parsed;\n const round = (channel: number) => Math.round(Math.min(Math.max(channel, 0), 255));\n const combined = Math.min(Math.max(existing * alpha, 0), 1);\n return `rgba(${round(r)}, ${round(g)}, ${round(b)}, ${Number(combined.toFixed(3))})`;\n}\n\n/**\n * Relative luminance per WCAG 2.1, or `null` for an unparseable colour.\n * The component uses it to decide whether it is drawing on a light or a dark\n * surface, which is the only thing it needs to know to pick sensible defaults\n * for a consumer who has set no custom properties at all.\n */\nexport function relativeLuminance(color: string): number | null {\n const parsed = parseColor(color);\n if (!parsed) {\n return null;\n }\n const [r, g, b] = parsed;\n const channel = (value: number) => {\n const sRgb = value / 255;\n return sRgb <= 0.03928 ? sRgb / 12.92 : Math.pow((sRgb + 0.055) / 1.055, 2.4);\n };\n return 0.2126 * channel(r) + 0.7152 * channel(g) + 0.0722 * channel(b);\n}\n","import { CHART_KIT_CSS_PROPERTIES, CHART_KIT_PALETTE } from './chart-kit-palette';\nimport { relativeLuminance, splitCssList, withAlpha } from './chart-kit-color';\nimport type { ChartKitTheme } from './chart-kit.types';\n\n/**\n * The slice of `CSSStyleDeclaration` the theme reader uses. Narrowing it to\n * this keeps the reader a pure function of resolved CSS, which is what makes\n * it testable without a browser.\n */\nexport interface ChartKitStyleSource {\n getPropertyValue(property: string): string;\n}\n\n/** Highest `--chart-kit-series-N` the reader looks for. */\nconst MAX_SERIES_SLOTS = 24;\n\n/** Used when the host has no colour of its own to inherit — a bare `<body>`. */\nconst FALLBACK_TEXT = '#1f2328';\nconst FALLBACK_FONT =\n 'system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif';\n\n/** Reads a property and returns `undefined` rather than the empty string. */\nfunction read(style: ChartKitStyleSource, property: string): string | undefined {\n const value = style.getPropertyValue(property)?.trim();\n return value ? value : undefined;\n}\n\n/**\n * True when a colour is absent or fully transparent. `getComputedStyle`\n * reports an unset background as `rgba(0, 0, 0, 0)`, which is not a surface\n * colour a chart can draw against.\n */\nfunction isTransparent(color: string | undefined): boolean {\n if (!color) {\n return true;\n }\n const value = color.trim().toLowerCase();\n return value === 'transparent' || /^rgba?\\([^)]*[\\s,/]0(?:\\.0+)?\\)$/.test(value);\n}\n\n/**\n * Resolves the palette: an explicit array wins, then\n * `--chart-kit-palette`, then the library default — and in every case\n * individual `--chart-kit-series-N` properties override single slots, so a\n * consumer can recolour one series without restating the rest.\n */\nfunction readPalette(\n style: ChartKitStyleSource,\n override: readonly string[] | undefined,\n): readonly string[] {\n const listed = read(style, CHART_KIT_CSS_PROPERTIES.palette);\n const base =\n override && override.length > 0\n ? [...override]\n : listed\n ? splitCssList(listed)\n : [...CHART_KIT_PALETTE];\n\n const palette = base.length > 0 ? base : [...CHART_KIT_PALETTE];\n\n for (let slot = 1; slot <= MAX_SERIES_SLOTS; slot += 1) {\n const value = read(style, `${CHART_KIT_CSS_PROPERTIES.seriesPrefix}${slot}`);\n if (!value) {\n continue;\n }\n // A slot past the end of the palette extends it, so a consumer can supply\n // a ninth colour without having to restate the first eight.\n palette[slot - 1] = value;\n }\n\n // A sparse array would hand chart.js `undefined` colours, so fill any gap\n // left by a consumer who set slot 10 but not slot 9.\n for (let index = 0; index < palette.length; index += 1) {\n palette[index] ??= CHART_KIT_PALETTE[index % CHART_KIT_PALETTE.length];\n }\n\n return palette;\n}\n\n/**\n * Builds a {@link ChartKitTheme} from resolved CSS on the chart's host.\n *\n * Only the palette, text colour and font have to come from anywhere: every\n * other value is derived from the text colour's luminance, so a consumer who\n * sets nothing at all still gets grid lines and tooltips that suit whichever\n * surface the chart has landed on. The derivation is the whole point of\n * reading at draw time — a dark-mode switch changes the inherited `color`, and\n * the chart follows without any input being rebound.\n */\nexport function readChartKitTheme(\n style: ChartKitStyleSource,\n paletteOverride?: readonly string[],\n): ChartKitTheme {\n const text = read(style, CHART_KIT_CSS_PROPERTIES.text) ?? read(style, 'color') ?? FALLBACK_TEXT;\n\n // Luminance of the *text* tells us about the surface behind it: light text\n // means a dark surface. `null` (an unparseable colour such as `oklch()`)\n // is treated as a light theme, the commoner default.\n const textLuminance = relativeLuminance(text);\n const onDarkSurface = textLuminance !== null && textLuminance > 0.5;\n\n const backgroundColor = read(style, 'background-color');\n const surface =\n read(style, CHART_KIT_CSS_PROPERTIES.surface) ??\n (isTransparent(backgroundColor) ? (onDarkSurface ? '#16181d' : '#ffffff') : backgroundColor!);\n\n const tooltipBackground =\n read(style, CHART_KIT_CSS_PROPERTIES.tooltipBackground) ??\n (onDarkSurface ? 'rgba(244, 246, 250, 0.94)' : 'rgba(24, 26, 31, 0.92)');\n\n const tooltipText =\n read(style, CHART_KIT_CSS_PROPERTIES.tooltipText) ?? (onDarkSurface ? '#16181d' : '#f7f8fa');\n\n return {\n palette: readPalette(style, paletteOverride),\n text,\n muted: read(style, CHART_KIT_CSS_PROPERTIES.muted) ?? withAlpha(text, 0.74),\n grid: read(style, CHART_KIT_CSS_PROPERTIES.grid) ?? withAlpha(text, 0.14),\n surface,\n tooltipBackground,\n tooltipText,\n font: read(style, CHART_KIT_CSS_PROPERTIES.font) ?? read(style, 'font-family') ?? FALLBACK_FONT,\n };\n}\n\n/** Colour for the series or slice at `index`, cycling through the palette. */\nexport function paletteColor(theme: ChartKitTheme, index: number): string {\n const { palette } = theme;\n if (palette.length === 0) {\n return CHART_KIT_PALETTE[index % CHART_KIT_PALETTE.length];\n }\n return palette[index % palette.length];\n}\n","import type {\n ChartKitData,\n ChartKitTableModel,\n ChartKitTableRow,\n ChartKitValueFormat,\n} from './chart-kit.types';\n\n/** Label synthesised for a data point that has no label of its own. */\nfunction fallbackLabel(index: number): string {\n return `Item ${index + 1}`;\n}\n\n/**\n * Coerces whatever a template binding holds into a value a chart can draw.\n *\n * `undefined` is what a binding holds while its data loads, and `NaN` is what\n * arithmetic on it produces. Both become `null`, which chart.js renders as a\n * gap and the table renders as words.\n */\nexport function toChartValue(value: number | null | undefined): number | null {\n return typeof value === 'number' && Number.isFinite(value) ? value : null;\n}\n\n/**\n * The number of rows the chart and its table both have.\n *\n * `labels` normally governs, but a series longer than `labels` would otherwise\n * have values that are drawn and never described — chart.js would plot them\n * against an unlabelled category. Taking the longest of the two keeps the\n * canvas and the table showing the same number of points, always.\n */\nexport function chartKitRowCount(data: ChartKitData): number {\n return data.series.reduce((longest, series) => Math.max(longest, series.data.length), data.labels.length);\n}\n\n/**\n * The category labels, padded to {@link chartKitRowCount} so every drawn point\n * has a name. This same array is handed to chart.js, so the axis ticks and the\n * table's row headers cannot drift apart.\n */\nexport function chartKitLabels(data: ChartKitData): string[] {\n const count = chartKitRowCount(data);\n const labels: string[] = [];\n for (let index = 0; index < count; index += 1) {\n const label = data.labels[index];\n labels.push(label !== undefined && label !== '' ? label : fallbackLabel(index));\n }\n return labels;\n}\n\n/** A formatter that renders numbers in the reader's locale. */\nexport function createDefaultValueFormat(\n locale?: string,\n emptyText = 'No data',\n): ChartKitValueFormat {\n return (value) => (value === null ? emptyText : value.toLocaleString(locale));\n}\n\n/** Everything {@link buildChartKitTable} needs. */\nexport interface ChartKitTableInput {\n readonly data: ChartKitData;\n readonly caption: string;\n readonly categoryHeader: string;\n readonly format: ChartKitValueFormat;\n}\n\n/**\n * Builds the table equivalent of a chart from the chart's own data.\n *\n * This is the function the library exists for. A `<canvas>` exposes nothing to\n * assistive technology — it is a bitmap — so every chart here also renders a\n * real `<table>` with a caption, a header row and a header column, built here\n * from the same {@link ChartKitData} the canvas draws. Because it is derived\n * rather than authored, it cannot fall out of date when the data changes.\n */\nexport function buildChartKitTable(input: ChartKitTableInput): ChartKitTableModel {\n const { data, caption, categoryHeader, format } = input;\n const labels = chartKitLabels(data);\n\n const rows: ChartKitTableRow[] = labels.map((label, pointIndex) => ({\n label,\n cells: data.series.map((series, seriesIndex) => {\n const value = toChartValue(series.data[pointIndex]);\n return {\n value,\n text: format(value, {\n seriesIndex,\n pointIndex,\n seriesLabel: series.label,\n label,\n }),\n };\n }),\n }));\n\n return {\n caption,\n categoryHeader,\n seriesHeaders: data.series.map((series) => series.label),\n rows,\n };\n}\n","import type { ChartConfiguration, TooltipItem } from 'chart.js';\nimport { paletteColor } from './chart-kit-theme';\nimport { chartKitLabels, toChartValue } from './chart-kit-table';\nimport { withAlpha } from './chart-kit-color';\nimport type {\n ChartKitData,\n ChartKitPoint,\n ChartKitTheme,\n ChartKitType,\n ChartKitValueFormat,\n} from './chart-kit.types';\n\n/** The chart.js controller each exposed form is drawn by. */\nconst CHART_JS_TYPE: Record<ChartKitType, 'bar' | 'line' | 'pie' | 'doughnut' | 'radar'> = {\n bar: 'bar',\n hbar: 'bar',\n line: 'line',\n area: 'line',\n pie: 'pie',\n doughnut: 'doughnut',\n radar: 'radar',\n};\n\n/** Forms that draw arcs around a centre and so have no cartesian scales. */\nfunction isRadial(type: ChartKitType): boolean {\n return type === 'pie' || type === 'doughnut';\n}\n\n/** Forms drawn against an x and a y axis. */\nfunction isCartesian(type: ChartKitType): boolean {\n return type === 'bar' || type === 'hbar' || type === 'line' || type === 'area';\n}\n\n/**\n * The axis carrying values rather than categories. A horizontal bar chart\n * swaps them, which is the only thing `hbar` changes.\n */\nfunction valueAxis(type: ChartKitType): 'x' | 'y' {\n return type === 'hbar' ? 'x' : 'y';\n}\n\n/**\n * A dataset as this library builds it.\n *\n * chart.js types a dataset per chart type, and the properties below span\n * several of those types, so there is no single chart.js dataset type to\n * declare this as. It is modelled here and cast once, in\n * {@link toChartConfiguration}, which keeps every other function in this file\n * fully typed against a shape we own.\n */\nexport interface ChartKitDataset {\n label: string;\n data: (number | null)[];\n backgroundColor: string | string[];\n borderColor: string | string[];\n borderWidth: number;\n borderRadius?: number;\n maxBarThickness?: number;\n fill?: boolean;\n tension?: number;\n pointRadius?: number;\n pointHoverRadius?: number;\n pointBackgroundColor?: string;\n pointBorderColor?: string;\n spanGaps?: boolean;\n hoverOffset?: number;\n}\n\n/** Everything needed to draw a chart. */\nexport interface ChartKitRenderInput {\n readonly type: ChartKitType;\n readonly data: ChartKitData;\n readonly theme: ChartKitTheme;\n readonly format: ChartKitValueFormat;\n /** The chart's accessible name, reused as the tooltip's aria context. */\n readonly caption: string;\n readonly stacked: boolean;\n readonly legend: boolean;\n readonly tooltips: boolean;\n readonly animate: boolean;\n readonly beginAtZero: boolean;\n readonly locale?: string;\n /** Called when a reader clicks a point; omitted when nobody is listening. */\n readonly onPointSelect?: (point: ChartKitPoint) => void;\n}\n\n/**\n * Builds the datasets for a chart.\n *\n * A pie or doughnut colours *per slice*, because its categories are what a\n * reader compares; every other form colours *per series*. That is the only\n * place the palette is consumed differently, and it is why colour assignment\n * lives here rather than in the component.\n */\nexport function buildChartKitDatasets(input: ChartKitRenderInput): ChartKitDataset[] {\n const { type, data, theme } = input;\n const rows = chartKitLabels(data).length;\n const radial = isRadial(type);\n\n return data.series.map((series, seriesIndex) => {\n const values: (number | null)[] = [];\n for (let index = 0; index < rows; index += 1) {\n values.push(toChartValue(series.data[index]));\n }\n\n // An explicit series colour wins, but it cannot follow a theme change —\n // the README says so, and the palette is the recommended route.\n const color = series.color ?? paletteColor(theme, seriesIndex);\n const sliceColors = radial\n ? Array.from({ length: rows }, (_, index) => series.color ?? paletteColor(theme, index))\n : undefined;\n\n const base: ChartKitDataset = {\n label: series.label,\n data: values,\n backgroundColor: sliceColors ?? color,\n borderColor: sliceColors ?? color,\n borderWidth: 0,\n };\n\n switch (type) {\n case 'bar':\n case 'hbar':\n return { ...base, borderRadius: 4, maxBarThickness: 64 };\n\n case 'line':\n case 'area':\n return {\n ...base,\n backgroundColor: type === 'area' ? withAlpha(color, 0.22) : color,\n borderColor: color,\n borderWidth: 2,\n fill: type === 'area',\n tension: 0.32,\n pointRadius: 3,\n pointHoverRadius: 5,\n pointBackgroundColor: color,\n pointBorderColor: theme.surface,\n // Left off on purpose: a `null` is missing data, and joining across\n // it would draw a line through a gap the table reports as absent.\n spanGaps: false,\n };\n\n case 'radar':\n return {\n ...base,\n backgroundColor: withAlpha(color, 0.2),\n borderColor: color,\n borderWidth: 2,\n fill: true,\n pointRadius: 3,\n pointHoverRadius: 5,\n pointBackgroundColor: color,\n pointBorderColor: theme.surface,\n };\n\n case 'pie':\n case 'doughnut':\n return {\n ...base,\n // The gap between slices is the page's own surface colour, so the\n // separation survives a dark-mode switch.\n borderColor: theme.surface,\n borderWidth: 2,\n hoverOffset: 6,\n };\n }\n });\n}\n\n/** Tick, grid and label styling shared by both cartesian axes. */\nfunction cartesianAxis(input: ChartKitRenderInput, axis: 'x' | 'y') {\n const { theme, type, stacked, beginAtZero } = input;\n const carriesValues = valueAxis(type) === axis;\n\n return {\n stacked,\n // Grid lines only across the value axis: lines along the category axis add\n // ink without helping anyone read a value off the chart.\n grid: { display: carriesValues, color: theme.grid, drawTicks: false },\n border: { color: theme.grid, display: true },\n ticks: {\n color: theme.muted,\n font: { family: theme.font, size: 12 },\n padding: 8,\n ...(carriesValues ? {} : { autoSkipPadding: 12 }),\n },\n ...(carriesValues && beginAtZero ? { beginAtZero: true } : {}),\n };\n}\n\n/** The tooltip's value line, formatted by the same function the table uses. */\nfunction tooltipLabel(input: ChartKitRenderInput, item: TooltipItem<'bar'>): string {\n const { data, format } = input;\n const labels = chartKitLabels(data);\n const seriesIndex = item.datasetIndex;\n const pointIndex = item.dataIndex;\n const series = data.series[seriesIndex];\n const value = toChartValue(item.raw as number | null | undefined);\n const text = format(value, {\n seriesIndex,\n pointIndex,\n seriesLabel: series?.label ?? '',\n label: labels[pointIndex] ?? '',\n });\n\n // With one series its name is already the chart's subject, so repeating it on\n // every tooltip line is noise.\n return data.series.length > 1 && series ? `${series.label}: ${text}` : text;\n}\n\n/**\n * Options for a chart.\n *\n * As with {@link ChartKitDataset}, the shape spans several of chart.js's\n * per-type option types and is modelled here rather than fought with.\n */\nexport interface ChartKitOptions {\n responsive: boolean;\n maintainAspectRatio: boolean;\n locale?: string;\n indexAxis?: 'x' | 'y';\n cutout?: string;\n animation: false | { duration: number };\n interaction: { mode: 'index' | 'nearest'; intersect: boolean };\n onClick?: (event: unknown, elements: { datasetIndex: number; index: number }[]) => void;\n scales?: Record<string, unknown>;\n plugins: Record<string, unknown>;\n}\n\n/** Builds the options object for a chart, colours and all. */\nexport function buildChartKitOptions(input: ChartKitRenderInput): ChartKitOptions {\n const { type, theme, data, legend, tooltips, animate, locale, onPointSelect } = input;\n const labels = chartKitLabels(data);\n\n const options: ChartKitOptions = {\n responsive: true,\n maintainAspectRatio: false,\n ...(locale ? { locale } : {}),\n animation: animate ? { duration: 420 } : false,\n interaction: isCartesian(type)\n ? { mode: 'index', intersect: false }\n : { mode: 'nearest', intersect: true },\n plugins: {\n legend: {\n // One unnamed series has nothing to disambiguate, so the legend is\n // suppressed unless it would actually tell a reader something.\n display: legend && (data.series.length > 1 || isRadial(type)),\n position: 'bottom',\n labels: {\n color: theme.text,\n font: { family: theme.font, size: 12 },\n usePointStyle: true,\n pointStyle: 'circle',\n boxWidth: 8,\n boxHeight: 8,\n padding: 16,\n },\n },\n tooltip: {\n enabled: tooltips,\n backgroundColor: theme.tooltipBackground,\n titleColor: theme.tooltipText,\n bodyColor: theme.tooltipText,\n borderColor: theme.grid,\n borderWidth: 1,\n padding: 10,\n cornerRadius: 6,\n displayColors: data.series.length > 1,\n titleFont: { family: theme.font, size: 12, weight: 'bold' as const },\n bodyFont: { family: theme.font, size: 12 },\n callbacks: {\n label: (item: TooltipItem<'bar'>) => tooltipLabel(input, item),\n },\n },\n },\n };\n\n if (type === 'hbar') {\n options.indexAxis = 'y';\n }\n\n if (type === 'doughnut') {\n options.cutout = '62%';\n }\n\n if (isCartesian(type)) {\n options.scales = {\n x: cartesianAxis(input, 'x'),\n y: cartesianAxis(input, 'y'),\n };\n }\n\n if (type === 'radar') {\n options.scales = {\n r: {\n beginAtZero: input.beginAtZero,\n grid: { color: theme.grid },\n angleLines: { color: theme.grid },\n pointLabels: { color: theme.muted, font: { family: theme.font, size: 12 } },\n ticks: {\n color: theme.muted,\n backdropColor: 'transparent',\n font: { family: theme.font, size: 11 },\n },\n },\n };\n }\n\n if (onPointSelect) {\n options.onClick = (_event, elements) => {\n const first = elements[0];\n if (!first) {\n return;\n }\n const series = data.series[first.datasetIndex];\n if (!series) {\n return;\n }\n const value = toChartValue(series.data[first.index]);\n onPointSelect({\n seriesIndex: first.datasetIndex,\n pointIndex: first.index,\n seriesLabel: series.label,\n label: labels[first.index] ?? '',\n value,\n });\n };\n }\n\n return options;\n}\n\n/**\n * The full chart.js configuration for a chart.\n *\n * The single cast in this function is where the shapes this library models\n * meet chart.js's per-type generics. Keeping it here, rather than spreading\n * `any` through the builders, means everything upstream of it type-checks.\n */\nexport function toChartConfiguration(input: ChartKitRenderInput): ChartConfiguration {\n const configuration = {\n type: CHART_JS_TYPE[input.type],\n data: {\n labels: chartKitLabels(input.data),\n datasets: buildChartKitDatasets(input),\n },\n options: buildChartKitOptions(input),\n };\n\n return configuration as unknown as ChartConfiguration;\n}\n\n/**\n * The part of `Chart` the update path touches.\n *\n * Declared structurally so the update-in-place behaviour can be tested against\n * a plain object — a real `Chart` needs a canvas with a 2d context, which is\n * exactly the thing a unit test has no business constructing.\n */\nexport interface ChartKitUpdatable {\n data: { labels?: unknown; datasets: unknown[] };\n options: unknown;\n update(mode?: 'none' | 'resize' | 'active' | 'hide' | 'show' | 'reset'): void;\n}\n\n/**\n * Pushes new data, colours and options into a chart that already exists.\n *\n * This is the reactive path: an input change recomputes the configuration and\n * hands it to chart.js's own `update()`, which keeps the canvas, the chart\n * instance, its event handlers and its animation state. Destroying and\n * rebuilding would be simpler to write and worse to use — it drops the\n * animation, flashes the canvas and loses any hover state the reader had.\n *\n * `labels` and `datasets` are reassigned rather than mutated element by\n * element, which is what lets a series be added or removed without the stale\n * one lingering.\n */\nexport function applyChartKitData(chart: ChartKitUpdatable, input: ChartKitRenderInput): void {\n chart.data.labels = chartKitLabels(input.data);\n chart.data.datasets = buildChartKitDatasets(input);\n chart.options = buildChartKitOptions(input);\n // `'none'` would skip the transition between values, which is the one piece\n // of animation that helps a reader follow a live-updating chart.\n chart.update(input.animate ? undefined : 'none');\n}\n\n/** The chart.js type a given form is drawn with; used when rebuilding. */\nexport function chartJsTypeFor(type: ChartKitType): string {\n return CHART_JS_TYPE[type];\n}\n\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n PLATFORM_ID,\n booleanAttribute,\n computed,\n effect,\n inject,\n input,\n numberAttribute,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport type { Chart } from 'chart.js';\nimport { loadChartJs } from './chart-js-loader';\nimport {\n applyChartKitData,\n chartJsTypeFor,\n toChartConfiguration,\n type ChartKitRenderInput,\n type ChartKitUpdatable,\n} from './chart-kit-config';\nimport { buildChartKitTable, createDefaultValueFormat } from './chart-kit-table';\nimport { readChartKitTheme, type ChartKitStyleSource } from './chart-kit-theme';\nimport type {\n ChartKitData,\n ChartKitPoint,\n ChartKitTableMode,\n ChartKitType,\n ChartKitValueFormat,\n} from './chart-kit.types';\n\n/** How each form is named in the chart's accessible name. */\nconst TYPE_NAMES: Record<ChartKitType, string> = {\n bar: 'bar chart',\n hbar: 'horizontal bar chart',\n line: 'line chart',\n area: 'area chart',\n pie: 'pie chart',\n doughnut: 'doughnut chart',\n radar: 'radar chart',\n};\n\n/** Document attributes a theme switch typically changes. */\nconst THEME_ATTRIBUTES = ['class', 'style', 'data-theme', 'data-mode', 'data-color-scheme'];\n\n/** Default height of the drawing area, in CSS pixels. */\nconst DEFAULT_HEIGHT = 320;\n\n/** Suffixes the generated element ids, so two charts never share one. */\nlet instanceCounter = 0;\n\n/**\n * An accessible, lazily-loaded, CSS-themed chart.\n *\n * Four things distinguish it from a thin chart.js wrapper, and they are worth\n * stating because they are the reason to use it:\n *\n * 1. Every chart renders a real `<table>` of the same data, visually hidden by\n * default. A `<canvas>` is a bitmap: assistive technology can see nothing\n * in it, so a chart without a text equivalent is a chart some readers\n * cannot read at all. Because the table is derived from the same input the\n * canvas draws, it cannot go stale.\n * 2. Inputs are signals. Changing one recomputes the configuration and hands\n * it to chart.js's `update()`, keeping the same chart instance.\n * 3. chart.js is imported dynamically on first draw, so it never lands in the\n * initial bundle, and every `document` / `window` / canvas touch is behind\n * `isPlatformBrowser`, so the component server-renders its table and\n * attaches the canvas only in a browser.\n * 4. Colours come from CSS custom properties on the host, read at draw time. A\n * consumer's dark-mode switch recolours the chart with no input rebound.\n */\n@Component({\n selector: 'chart-kit',\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (isBrowser) {\n <div class=\"chart-kit__canvas\" [style.height.px]=\"safeHeight()\">\n <canvas\n #canvas\n role=\"img\"\n [attr.aria-label]=\"accessibleName()\"\n [attr.aria-describedby]=\"description() ? descriptionId : null\"\n ></canvas>\n </div>\n }\n\n <div class=\"chart-kit__data\" [class.chart-kit__data--hidden]=\"dataTable() === 'hidden'\">\n @if (description()) {\n <p class=\"chart-kit__description\" [id]=\"descriptionId\">{{ description() }}</p>\n }\n\n <table class=\"chart-kit__table\">\n <caption class=\"chart-kit__caption\">\n {{ caption() }}\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">{{ table().categoryHeader }}</th>\n @for (header of table().seriesHeaders; track $index) {\n <th scope=\"col\">{{ header }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of table().rows; track $index) {\n <tr>\n <th scope=\"row\">{{ row.label }}</th>\n @for (cell of row.cells; track $index) {\n <td>{{ cell.text }}</td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n `,\n styles: `\n :host {\n display: block;\n position: relative;\n }\n\n .chart-kit__canvas {\n position: relative;\n width: 100%;\n }\n\n .chart-kit__canvas canvas {\n display: block;\n }\n\n /*\n * The clip-path technique rather than display:none or visibility:hidden:\n * both of those take the table out of the accessibility tree as well as\n * out of the layout, which would defeat the entire point of rendering it.\n */\n .chart-kit__data--hidden {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n white-space: nowrap;\n border: 0;\n clip-path: inset(50%);\n }\n\n .chart-kit__description {\n margin: 0 0 0.5rem;\n }\n\n .chart-kit__table {\n width: 100%;\n border-collapse: collapse;\n font: inherit;\n text-align: left;\n }\n\n .chart-kit__caption {\n padding-block: 0.5rem;\n font-weight: 600;\n text-align: left;\n }\n\n .chart-kit__table th,\n .chart-kit__table td {\n padding: 0.375rem 0.5rem;\n border-bottom: 1px solid var(--chart-kit-grid, currentColor);\n }\n\n .chart-kit__table td {\n text-align: right;\n font-variant-numeric: tabular-nums;\n }\n `,\n})\nexport class NgxChartKitComponent {\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly canvasRef = viewChild<ElementRef<HTMLCanvasElement>>('canvas');\n\n /**\n * Whether this is running in a browser. Read by the template, which renders\n * the table on both platforms but the canvas only here.\n */\n protected readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n /** Id of the description paragraph, referenced by the canvas. */\n protected readonly descriptionId = `chart-kit-description-${(instanceCounter += 1)}`;\n\n /** The data to draw, and the data the accessible table is built from. */\n readonly data = input.required<ChartKitData>();\n\n /**\n * The chart's accessible name and the table's `<caption>`. Required: a chart\n * nobody can name is a chart some readers cannot use, and making it optional\n * would mean most charts shipped without one.\n */\n readonly caption = input.required<string>();\n\n /** Which form to draw. */\n readonly type = input<ChartKitType>('bar');\n\n /**\n * A longer explanation — what the chart shows, where the numbers come from.\n * Rendered above the table and referenced by the canvas's\n * `aria-describedby`.\n */\n readonly description = input('');\n\n /** Header of the table's first column, naming what the row headers are. */\n readonly categoryHeader = input('Category');\n\n /**\n * Where the data table goes: `'hidden'` (the default) keeps it in the\n * accessibility tree but out of sight, `'visible'` renders it under the\n * chart. There is deliberately no third value that removes it.\n */\n readonly dataTable = input<ChartKitTableMode>('hidden');\n\n /** Height of the drawing area, in CSS pixels. Width follows the host. */\n readonly height = input(DEFAULT_HEIGHT, { transform: numberAttribute });\n\n /** Stack series on top of one another. Applies to bar and area charts. */\n readonly stacked = input(false, { transform: booleanAttribute });\n\n /**\n * Show the legend. Ignored for a single-series cartesian chart, where a\n * legend of one entry tells a reader nothing the caption has not.\n */\n readonly legend = input(true, { transform: booleanAttribute });\n\n /** Show tooltips on hover. */\n readonly tooltips = input(true, { transform: booleanAttribute });\n\n /**\n * Animate transitions. Forced off when the reader has asked for reduced\n * motion, whatever this is set to.\n */\n readonly animate = input(true, { transform: booleanAttribute });\n\n /** Start the value axis at zero, so bar lengths stay proportional. */\n readonly beginAtZero = input(true, { transform: booleanAttribute });\n\n /**\n * Overrides the palette from TypeScript. The CSS custom properties are the\n * better route — a palette passed here cannot follow a theme change — but\n * this exists for a palette that comes from data rather than from design.\n */\n readonly palette = input<readonly string[] | undefined>(undefined);\n\n /** Locale for the default number formatting. Defaults to the runtime's. */\n readonly locale = input<string | undefined>(undefined);\n\n /**\n * Formats a value for both the table and the tooltip, so the two can never\n * disagree. Takes the value and its position; see `ChartKitValueFormat`.\n */\n readonly valueFormat = input<ChartKitValueFormat | undefined>(undefined);\n\n /** Table text for a missing value. Read aloud, so not an empty string. */\n readonly emptyValueText = input('No data');\n\n /**\n * A point the reader clicked. Supplementary to the table, not a replacement\n * for it: this is a pointer affordance, and the table is the path that works\n * without one.\n */\n readonly pointSelect = output<ChartKitPoint>();\n\n /**\n * The chart.js instance, once created, and again after a rebuild. The\n * deliberate escape hatch: reach for it to register a plugin or read a\n * scale, rather than expecting this component to re-export chart.js's\n * options object.\n */\n readonly chartCreate = output<Chart>();\n\n /**\n * Something went wrong drawing the chart: the chart.js chunk failed to load,\n * or the canvas refused a 2d context. Emitted rather than thrown so a\n * consumer can show a fallback — and because an input-driven draw happens\n * outside any call a consumer could wrap in a `try`. The table equivalent is\n * already on the page either way, which is the point of rendering it from\n * the data rather than from the chart.\n */\n readonly renderError = output<unknown>();\n\n /** Bumped whenever something that could have changed the CSS has changed. */\n private readonly themeRevision = signal(0);\n\n /** Whether the reader has asked for reduced motion. */\n private readonly reducedMotion = signal(false);\n\n /** Height, with a non-finite binding falling back to the default. */\n protected readonly safeHeight = computed(() => {\n const height = this.height();\n return Number.isFinite(height) && height > 0 ? height : DEFAULT_HEIGHT;\n });\n\n /**\n * Colours and fonts, re-read from the host's resolved CSS every time\n * {@link themeRevision} changes. On the server there is no computed style to\n * read, so the reader falls back to its documented defaults.\n */\n private readonly theme = computed(() => {\n this.themeRevision();\n const style: ChartKitStyleSource = this.isBrowser\n ? getComputedStyle(this.host.nativeElement)\n : { getPropertyValue: () => '' };\n return readChartKitTheme(style, this.palette());\n });\n\n /** The formatter the table and the tooltips share. */\n private readonly format = computed<ChartKitValueFormat>(\n () => this.valueFormat() ?? createDefaultValueFormat(this.locale(), this.emptyValueText()),\n );\n\n /** The chart's accessible name: the caption, plus what kind of chart it is. */\n protected readonly accessibleName = computed(\n () => `${this.caption()}. ${TYPE_NAMES[this.type()]}. Described by the table that follows.`,\n );\n\n /** The table equivalent of the chart. */\n protected readonly table = computed(() =>\n buildChartKitTable({\n data: this.data(),\n caption: this.caption(),\n categoryHeader: this.categoryHeader(),\n format: this.format(),\n }),\n );\n\n /** Everything the chart.js configuration is built from. */\n private readonly renderInput = computed<ChartKitRenderInput>(() => ({\n type: this.type(),\n data: this.data(),\n theme: this.theme(),\n format: this.format(),\n caption: this.caption(),\n stacked: this.stacked(),\n legend: this.legend(),\n tooltips: this.tooltips(),\n animate: this.animate() && !this.reducedMotion(),\n beginAtZero: this.beginAtZero(),\n locale: this.locale(),\n onPointSelect: (point) => this.pointSelect.emit(point),\n }));\n\n private chart?: Chart;\n\n /** The chart.js type the live instance was built with. */\n private chartJsType?: string;\n\n /** Guards against an out-of-order draw resolving after a newer one. */\n private drawToken = 0;\n\n private destroyed = false;\n\n /** Coalesces a burst of theme notifications into one re-read. */\n private themeRefreshScheduled = false;\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n\n if (this.isBrowser) {\n this.watchColorScheme(destroyRef);\n }\n\n effect(() => {\n const input = this.renderInput();\n // Reading the view child here is what drives the first draw: the signal\n // is unset until the canvas is in the DOM, and setting it re-runs this\n // effect. On the server it never resolves, so nothing is ever drawn.\n const canvas = this.canvasRef()?.nativeElement;\n if (!canvas) {\n return;\n }\n void this.draw(input, canvas).catch((error: unknown) => {\n if (!this.destroyed) {\n this.renderError.emit(error);\n }\n });\n });\n\n destroyRef.onDestroy(() => {\n this.destroyed = true;\n this.chart?.destroy();\n this.chart = undefined;\n });\n }\n\n /**\n * Re-reads the host's CSS and redraws.\n *\n * The component already watches `prefers-color-scheme` and the attributes a\n * theme switch usually changes, which covers the common cases. Call this\n * when a theme is switched some other way — a stylesheet swapped at runtime,\n * a custom property set from script on an ancestor.\n */\n refreshTheme(): void {\n this.themeRevision.update((revision) => revision + 1);\n }\n\n /** Draws or updates the chart. */\n private async draw(input: ChartKitRenderInput, canvas: HTMLCanvasElement): Promise<void> {\n const token = (this.drawToken += 1);\n const ChartConstructor = await loadChartJs(input.type);\n\n // Between the await and here, the component may have been destroyed or a\n // newer input may have started its own draw. Either way this one is void.\n if (this.destroyed || token !== this.drawToken) {\n return;\n }\n\n const chartJsType = chartJsTypeFor(input.type);\n\n if (this.chart && this.chartJsType === chartJsType) {\n // The reactive path: same canvas, same instance, same hover state.\n // `line` and `area` share a controller, as do `bar` and `hbar`, so\n // switching between those pairs comes through here too.\n applyChartKitData(this.chart as unknown as ChartKitUpdatable, input);\n return;\n }\n\n this.chart?.destroy();\n this.chart = new ChartConstructor(canvas, toChartConfiguration(input));\n this.chartJsType = chartJsType;\n this.chartCreate.emit(this.chart);\n }\n\n /**\n * Watches for the things that change a chart's colours: the OS colour\n * scheme, and the document attributes an in-app theme toggle sets. The\n * second matters more in practice — most applications switch themes with a\n * class on `<html>`, not by asking the OS.\n */\n private watchColorScheme(destroyRef: DestroyRef): void {\n const onSchemeChange = () => this.scheduleThemeRefresh();\n\n // `isPlatformBrowser` is true in plenty of places that are not a full\n // browser — a jsdom test of a consumer's own application, an embedded\n // webview — so each of these is feature-detected rather than assumed. A\n // chart still draws without them; it just stops noticing theme changes on\n // its own, which `refreshTheme()` covers.\n if (typeof window.matchMedia === 'function') {\n const dark = window.matchMedia('(prefers-color-scheme: dark)');\n const motion = window.matchMedia('(prefers-reduced-motion: reduce)');\n const onMotionChange = () => this.reducedMotion.set(motion.matches);\n\n this.reducedMotion.set(motion.matches);\n dark.addEventListener('change', onSchemeChange);\n motion.addEventListener('change', onMotionChange);\n\n destroyRef.onDestroy(() => {\n dark.removeEventListener('change', onSchemeChange);\n motion.removeEventListener('change', onMotionChange);\n });\n }\n\n if (typeof MutationObserver === 'function') {\n const observer = new MutationObserver(onSchemeChange);\n for (const element of [document.documentElement, document.body, this.host.nativeElement]) {\n if (element) {\n observer.observe(element, { attributes: true, attributeFilter: THEME_ATTRIBUTES });\n }\n }\n destroyRef.onDestroy(() => observer.disconnect());\n }\n }\n\n /**\n * Defers the re-read to the next frame. A theme toggle often sets several\n * attributes at once, and the new custom property values are not resolved\n * until the browser has restyled, so reading synchronously from the\n * observer would read the old palette.\n */\n private scheduleThemeRefresh(): void {\n if (this.themeRefreshScheduled) {\n return;\n }\n this.themeRefreshScheduled = true;\n const run = () => {\n this.themeRefreshScheduled = false;\n if (!this.destroyed) {\n this.refreshTheme();\n }\n };\n\n if (typeof requestAnimationFrame === 'function') {\n requestAnimationFrame(run);\n } else {\n setTimeout(run);\n }\n }\n}\n"],"mappings":";;;AAuBA,IAAI,gBAA+C;AACnD,MAAM,kCAAkB,IAAI,IAAG;AAG/B,SAAS,gBAAgB,QAAuB,MAAkB;CAChE,MAAM,SAAS,CAAC,OAAO,QAAQ,OAAO,OAAO;CAE7C,QAAQ,MAAR;EACE,KAAK;EACL,KAAK,QACH,OAAO;GACL,GAAG;GACH,OAAO;GACP,OAAO;GACP,OAAO;GACP,OAAO;EACR;EA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AA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,gBAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,aAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,aAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,aAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,60 @@
1
1
  {
2
2
  "name": "@angx/ngx-chart-kit",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "Accessible, signal-based chart.js components for Angular: every chart ships a screen-reader data table, loads chart.js lazily and takes its colours from CSS custom properties.",
5
+ "license": "MIT",
6
+ "author": {
7
+ "name": "Abhishek Singh",
8
+ "url": "https://coderabhi.in"
9
+ },
10
+ "homepage": "https://coderabhi.in/ngx-chart-kit.html",
11
+ "bugs": {
12
+ "url": "https://github.com/angx-libs/ngx-chart-kit/issues"
13
+ },
14
+ "peerDependencies": {
15
+ "@angular/common": "^21.0.0 || ^22.0.0",
16
+ "@angular/core": "^21.0.0 || ^22.0.0",
17
+ "chart.js": "^4.4.0"
18
+ },
19
+ "dependencies": {
20
+ "tslib": "^2.8.1"
21
+ },
22
+ "sideEffects": false,
23
+ "keywords": [
24
+ "angular",
25
+ "angular charts",
26
+ "accessible charts",
27
+ "angular chart.js",
28
+ "ngx charts",
29
+ "ngx chart kit",
30
+ "a11y charts",
31
+ "screen reader charts",
32
+ "signals",
33
+ "standalone",
34
+ "ssr",
35
+ "zoneless",
36
+ "lazy loaded charts",
37
+ "dark mode charts",
38
+ "chart.js"
39
+ ],
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "git+https://github.com/angx-libs/ngx-chart-kit.git"
43
+ },
44
+ "funding": {
45
+ "type": "buymeacoffee",
46
+ "url": "https://buymeacoffee.com/er.abhishek"
47
+ },
48
+ "module": "fesm2022/angx-ngx-chart-kit.mjs",
49
+ "typings": "types/angx-ngx-chart-kit.d.ts",
50
+ "exports": {
51
+ "./package.json": {
52
+ "default": "./package.json"
53
+ },
54
+ ".": {
55
+ "types": "./types/angx-ngx-chart-kit.d.ts",
56
+ "default": "./fesm2022/angx-ngx-chart-kit.mjs"
57
+ }
58
+ },
59
+ "type": "module"
6
60
  }