@pioneer-code/pioneer-charts 22.2.1 → 22.2.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"pioneer-code-pioneer-charts.mjs","sources":["../../../projects/pioneer-charts/src/lib/core/chart.model.ts","../../../projects/pioneer-charts/src/lib/core/axis.builder.ts","../../../projects/pioneer-charts/src/lib/core/grid.builder.ts","../../../projects/pioneer-charts/src/lib/core/color.service.ts","../../../projects/pioneer-charts/src/lib/core/transition.service.ts","../../../projects/pioneer-charts/src/lib/core/tooltip.builder.ts","../../../projects/pioneer-charts/src/lib/core/chart.ts","../../../projects/pioneer-charts/src/lib/core/stack.ts","../../../projects/pioneer-charts/src/lib/bar-chart/bar-horizontal-chart/bar-horizontal-chart.builder.ts","../../../projects/pioneer-charts/src/lib/core/resize.service.ts","../../../projects/pioneer-charts/src/lib/core/tooltip.directive.ts","../../../projects/pioneer-charts/src/lib/bar-chart/bar-horizontal-chart/bar-horizontal-chart.component.ts","../../../projects/pioneer-charts/src/lib/bar-chart/bar-horizontal-chart/bar-horizontal-chart.component.html","../../../projects/pioneer-charts/src/lib/bar-chart/bar-horizontal-chart/bar-horizontal-chart.model.ts","../../../projects/pioneer-charts/src/lib/bar-chart/bar-vertical-chart/bar-vertical-chart.builder.ts","../../../projects/pioneer-charts/src/lib/bar-chart/bar-vertical-chart/bar-vertical-chart.component.ts","../../../projects/pioneer-charts/src/lib/bar-chart/bar-vertical-chart/bar-vertical-chart.component.html","../../../projects/pioneer-charts/src/lib/bar-chart/bar-vertical-chart/bar-vertical-chart.model.ts","../../../projects/pioneer-charts/src/lib/legend/legend.component.ts","../../../projects/pioneer-charts/src/lib/legend/legend.component.html","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/plot-line-area-chart.model.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/core/builders/effects.builders.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/core/builders/scales.builder.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/core/x-format.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/core/builders/line-generator.builder.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/core/builders/area-generator.builder.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/core/builders/zoom-behavior.builder.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/core/builders/chart.builder.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/plot-line-area-chart.component.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/plot-line-area-chart.component.html","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/plot/plot.component.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/plot/plot.component.html","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/plot/plot.model.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/line/line.component.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/line/line.component.html","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/line/line.model.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/area/area.component.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/area/area.component.html","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/area/area.model.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/public-api.ts","../../../projects/pioneer-charts/src/lib/pie-chart/pie-chart.builder.ts","../../../projects/pioneer-charts/src/lib/pie-chart/pie-chart.component.ts","../../../projects/pioneer-charts/src/lib/pie-chart/pie-chart.component.html","../../../projects/pioneer-charts/src/lib/pie-chart/pie-chart.model.ts","../../../projects/pioneer-charts/src/public-api.ts","../../../projects/pioneer-charts/src/pioneer-code-pioneer-charts.ts"],"sourcesContent":["/**\n * Base configuration for all charts.\n * INewChart extends IChart\n */\nexport class PcacChartConfig {\n /**\n * Height in pixels\n */\n data: PcacData[] = []\n height: number = 200\n\n /**\n * When true, `height` becomes a *minimum* height: if the container the chart is placed in is\n * taller than `height`, the chart grows to fill it instead.\n *\n * The chart fills its own host element (`<pcac-bar-vertical-chart>` etc.), which it stretches\n * to `height: 100%` while this is on - so the consumer just needs to give the element wrapping\n * the chart a definite height (an explicit height, or a flex/grid track that resolves to one).\n * If that wrapper turns out to be auto-height, there's nothing definite to fill and the chart\n * falls back to `height`.\n *\n * Optional (rather than defaulted like the properties above) so that adding it doesn't force\n * every existing consumer that builds a config as an object literal to declare it; the `= false`\n * initializer still applies to anything constructed via `new`.\n */\n heightFull?: boolean = false\n}\n\n/**\n * Up to three short labels placed along an axis by position rather than by value: `min` at its\n * start, `mid` at its center, `max` at its end. Any subset can be given.\n */\nexport class PcacAxisSubLabels {\n min?: string\n mid?: string\n max?: string\n}\n\n/**\n * Everything configurable about one axis. Used twice per chart, as `xAxis` and `yAxis` on\n * `PcacAxisChartConfig`, so the two never drift apart and a new per-axis option lands in one place.\n *\n * Every field is optional so an object-literal / JSON config can give just the ones it cares\n * about (or omit the axis entirely); the initializers apply to anything built with `new`, and\n * `resolveAxisConfig()` fills the rest in for builders.\n */\nexport class PcacAxisConfig {\n /**\n * Don't draw this axis at all (labels, tick marks, line), and give the margins it would have\n * occupied back to the plot area. Hiding the y axis reclaims the left and top margins; hiding\n * the x axis reclaims the bottom and right. The chart's total footprint doesn't change.\n */\n hide?: boolean = false\n\n /**\n * Draw grid lines from this axis's ticks (or, on a category axis, from each category) across\n * the plot: horizontal lines for the y axis, vertical for the x. Left unset, each chart keeps\n * the grid it has always drawn - the y axis's on vertical bar and line/area/plot charts, the\n * x axis's on the horizontal bar chart - and no other; set it to turn either grid on or off\n * explicitly. Deliberately has no initializer, since \"unset\" is what carries the per-chart\n * default.\n */\n showGrid?: boolean\n\n /**\n * Requested number of ticks (D3's `ticks()` hint, so the actual count can differ slightly) -\n * also the number of grid lines for this axis. Ignored by a category (band) axis, which has one\n * tick per category. Default 5.\n */\n ticks?: number = 5\n\n /**\n * Length in pixels of the small tick marks. Tick marks are not drawn at all unless this is set\n * (the theme hides them, as it always has), so setting a size is also what turns them on; D3's\n * default 6px is a sensible first value. `0` keeps them off but still pulls the labels in to\n * the axis. Labels follow the marks (D3 places them at tick length + 3px), and the chart's\n * margins grow or shrink by the same amount so the plot area makes room for them - a longer\n * tick means a slightly smaller plot, never labels pushed off the edge. Only the per-tick marks\n * change; the axis line's two end-caps keep their default length. Color comes from the theme\n * (`.pcac-axis-tick-marks .tick line`, `$gray-900`, the same as the axis line).\n */\n tickSize?: number\n\n /**\n * Draw a solid line along the axis itself (the full length of the axis, with D3's short\n * end-caps). Off by default, as the theme has always hidden it. Color comes from the theme\n * (`.pcac-axis-line .domain`, `$gray-900`).\n */\n showLine?: boolean = false\n\n /**\n * A title for the whole axis (e.g. \"Revenue ($)\"), drawn centered along it just inside the\n * chart's edge: below the tick labels for the x axis, rotated to read bottom-to-top left of\n * them for the y axis. The chart's margin grows by `PcacChart.AXIS_LABEL_SPACE` to make room,\n * shrinking the plot area the same way a longer tick does. Not drawn on a hidden axis. Styled\n * by the theme's `.pcac-axis-label` rule.\n */\n label?: string\n\n /**\n * Min / mid / max sub labels (e.g. \"Low\" / \"Medium\" / \"High\") in their own row just outside the\n * tick labels, and inside the `label` if there is one: `min` left-aligned at the axis's start,\n * `mid` centered, `max` right-aligned at its end, so they never spill past the axis. On the\n * y axis they run bottom-to-top like the label, `min` at the bottom. The margin grows by\n * `PcacChart.AXIS_SUB_LABEL_SPACE` when any is set, shrinking the plot area. Not drawn on a\n * hidden axis. Styled by the theme's `.pcac-axis-sub-label` rule.\n */\n subLabels?: PcacAxisSubLabels\n\n /**\n * How the values along this axis are interpreted and shown - the tick labels, and the value\n * (`yAxis`) or key (`xAxis`) in the default tooltip. On the line/area/plot charts the x axis's\n * format is also what decides how a point's `key` maps to an x position (by index for the\n * default, `Decimal` and `DateTime` by the key's own value on a linear/time scale - see\n * `PcacLineAreaChartConfig`); a bar chart's category axis ignores it. Default `None`, which\n * on those charts behaves as `DatasetLength`.\n */\n format?: PcacFormatEnum = PcacFormatEnum.None\n\n /**\n * The value axis's domain: it runs from `domainMin` to `domainMax`, ignoring the data. Defaults\n * 0 and 100. Only the type of axis that has a domain to set reads them - a bar chart's category\n * axis ignores both, its value axis reads `domainMax` only (bars always grow from 0), and a\n * line/area/plot chart's x axis reads them only under the `Decimal` (numbers) and `DateTime`\n * (anything `new Date()` accepts, and required) formats - the index-based formats size the\n * axis from the data.\n */\n domainMin?: number | string = 0\n domainMax?: number | string = 100\n}\n\n/**\n * The `PcacChartMargin` type lives here rather than in chart.ts so the axis builder can take\n * one without importing the class module that imports it back.\n */\nexport interface PcacChartMargin {\n top: number;\n right: number;\n bottom: number;\n left: number;\n}\n\n/**\n * `PcacAxisConfig` with every default applied - what builders work with, so they never have to\n * null-check. `tickSize`, `label` and `subLabels` stay optional: \"not set\" is itself the meaningful\n * default (no marks, no labels).\n */\nexport type PcacResolvedAxisConfig = Required<Omit<PcacAxisConfig, 'tickSize' | 'label' | 'subLabels'>> & Pick<PcacAxisConfig, 'tickSize' | 'label' | 'subLabels'>;\n\n/** True if `axis` has at least one sub label to draw (an empty `subLabels` object counts as none). */\nexport function hasAxisSubLabels(axis: PcacAxisConfig | undefined): boolean {\n const sub = axis?.subLabels;\n return !!sub && (!!sub.min || !!sub.mid || !!sub.max);\n}\n\n/**\n * Room reserved in a margin for an axis `label`: the theme's 12px label plus a gap from the tick\n * labels. Reserved on the side the label sits on (`bottom` for x, `left` for y), and taken out\n * of the plot area, the same way a longer tick is. Change together with `.pcac-axis-label`.\n */\nexport const PCAC_AXIS_LABEL_SPACE = 18;\n\n/** Likewise for a row of `subLabels`: the theme's 11px text plus a gap (`.pcac-axis-sub-label`). */\nexport const PCAC_AXIS_SUB_LABEL_SPACE = 16;\n\n/**\n * Total margin an axis's `label` and `subLabels` take on its side. `PcacChart` reserves it and\n * the axis builder places the text by it, so the two stay in step.\n */\nexport function axisLabelSpace(axis: PcacAxisConfig | undefined): number {\n return (axis?.label ? PCAC_AXIS_LABEL_SPACE : 0) + (hasAxisSubLabels(axis) ? PCAC_AXIS_SUB_LABEL_SPACE : 0);\n}\n\n/**\n * @param showGridDefault what `showGrid` resolves to when the consumer left it unset - each chart\n * passes `true` for the axis whose grid it has always drawn and `false` for the other.\n */\nexport function resolveAxisConfig(axis?: PcacAxisConfig, showGridDefault = false): PcacResolvedAxisConfig {\n const defaults = new PcacAxisConfig();\n return {\n hide: axis?.hide ?? defaults.hide!,\n showGrid: axis?.showGrid ?? showGridDefault,\n ticks: axis?.ticks ?? defaults.ticks!,\n tickSize: axis?.tickSize,\n showLine: axis?.showLine ?? defaults.showLine!,\n label: axis?.label,\n subLabels: axis?.subLabels,\n format: axis?.format ?? defaults.format!,\n domainMin: axis?.domainMin ?? defaults.domainMin!,\n domainMax: axis?.domainMax ?? defaults.domainMax!,\n };\n}\n\n/**\n * Base configuration for every chart that has an x and y axis (bar, line, area, plot - not pie).\n */\nexport class PcacAxisChartConfig extends PcacChartConfig {\n xAxis?: PcacAxisConfig = new PcacAxisConfig()\n yAxis?: PcacAxisConfig = new PcacAxisConfig()\n}\n\nexport class PcacData {\n key: string | number | null = null\n value: string | number| null = null\n hide: boolean = false\n data: PcacData[] = []\n\n /**\n * URL (or data URI) of an image to draw at this point *in place of* its dot. Currently honored\n * by the line/area/plot charts only, on the innermost (point-level) `PcacData`; sized by the\n * chart config's `pointImage` (see `PcacLineAreaChartConfig.pointImage`). Points without one\n * keep their regular dot, so the two can be mixed within a single series.\n *\n * Optional (rather than defaulted) for the same reason as `PcacChartConfig.heightFull`: so\n * existing object-literal / JSON data doesn't have to declare it.\n */\n image?: string\n}\n\nexport enum PcacFormatEnum {\n None = 'none',\n Decimal = 'decimal',\n DatasetLength = 'datasetLength',\n Percentage = 'percentage',\n Minutes = 'minutes',\n DateTime = 'dateTime',\n Fahrenheit = 'fahrenheit',\n\n /**\n * Expectation is we will be given a range of data from 0-23\n * and we will map that to a 12 hour clock with am/pm\n * e.g. 0 = 12am, 1 = 1am, 13 = 1pm, 23 = 11pm\n */\n OneDayHours = 'oneDayHours'\n}\n\n","import { Injectable } from '@angular/core';\nimport { axisBottom, axisLeft, AxisScale, AxisDomain } from 'd3-axis';\nimport { BaseType, Selection } from 'd3-selection';\nimport { PCAC_AXIS_LABEL_SPACE, PcacChartMargin, PcacFormatEnum, PcacResolvedAxisConfig } from './chart.model';\nimport { format } from 'd3-format';\n\n/**\n * Generic over each axis's own domain type (e.g. `number` for a value axis's `ScaleLinear`,\n * `string` for a category axis's `ScaleBand`) rather than `any`, since the two axes on a chart\n * routinely have different domain types and each real D3 scale already satisfies `AxisScale`\n * structurally - no widening needed at the type level.\n */\nexport interface IPcacAxisBuilderConfig<XDomain extends AxisDomain = AxisDomain, YDomain extends AxisDomain = AxisDomain> {\n svg: Selection<SVGGElement, unknown, BaseType, unknown>;\n /** Plot area size - the axes' own lengths - and the chart's margins, which position a `label`. */\n width: number;\n height: number;\n margin: PcacChartMargin;\n xScale: AxisScale<XDomain>;\n yScale: AxisScale<YDomain>;\n /**\n * The chart's per-axis settings, defaults already applied (`resolveAxisConfig()`). `hide` skips\n * the axis entirely. `tickSize` is D3's `tickSizeInner`; left undefined, D3's default of 6\n * applies to the geometry - but the theme hides tick marks unless the axis group carries\n * `pcac-axis-tick-marks`, which is added exactly when a size is given, so an undefined size\n * means \"no visible marks, labels where they've always been\". `0` is a legitimate value (no\n * marks, labels hugging the axis), hence the `!== undefined` checks below. `showLine` adds\n * `pcac-axis-line`, which un-hides D3's `.domain` path the same way. The domain path keeps\n * D3's default 6px outer end-caps (`tickSizeOuter`), so it reads as a bracket rather than a\n * bare rule; that's D3's standard look and is left as-is. `label` and `subLabels` are drawn\n * inside the axis group (so they're raised and non-interactive along with it) - see `drawLabels`.\n * `format` picks the tick label format; `None` leaves D3's default.\n */\n xAxis: PcacResolvedAxisConfig;\n yAxis: PcacResolvedAxisConfig;\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PcacAxisBuilder {\n drawAxis<XDomain extends AxisDomain, YDomain extends AxisDomain>(config: IPcacAxisBuilderConfig<XDomain, YDomain>): void {\n this.drawXAxis(config);\n this.drawYAxis(config);\n }\n\n /**\n * Moves both axis groups to the end of the chart's `<g>`, so they paint over everything drawn\n * since `drawAxis()`. Axes are drawn first (so scales and margins are settled before content),\n * which leaves anything sitting at x = 0 - a line chart's first segment and dot, an area's fill,\n * a horizontal bar chart's bars - painting over the y axis line. Builders call this after the\n * content that should sit *under* the axes, and draw anything that should stay on top (the\n * line/area/plot charts' dots) afterwards. Safe to sit above the hover/zoom overlay rects too,\n * because the groups are `pointer-events: none` (set where each group is appended).\n */\n raiseAxes(svg: Selection<SVGGElement, unknown, BaseType, unknown>): void {\n svg.selectAll('.pcac-x-axis, .pcac-y-axis').raise();\n }\n\n drawYAxis<XDomain extends AxisDomain, YDomain extends AxisDomain>(config: IPcacAxisBuilderConfig<XDomain, YDomain>) {\n if (config.yAxis.hide) return;\n\n const yAxis = axisLeft(config.yScale).ticks(config.yAxis.ticks);\n if (config.yAxis.tickSize !== undefined) {\n yAxis.tickSizeInner(config.yAxis.tickSize);\n }\n\n switch (config.yAxis.format) {\n case PcacFormatEnum.Percentage:\n yAxis.tickFormat(d => d + \"%\");\n break;\n case PcacFormatEnum.Minutes:\n yAxis.tickFormat((d) => d + 'm');\n break;\n case PcacFormatEnum.Fahrenheit:\n yAxis.tickFormat((d) => d + ' F');\n break;\n }\n\n const group = config.svg.append('g')\n .attr('class', 'pcac-y-axis')\n // Axes are raised above the interactive overlays (see raiseAxes) and take no mouse events\n .attr('pointer-events', 'none')\n .classed('pcac-axis-tick-marks', config.yAxis.tickSize !== undefined)\n .classed('pcac-axis-line', config.yAxis.showLine)\n .call(yAxis);\n\n this.drawLabels(group, config.yAxis, { length: config.height, outer: config.margin.left, vertical: true });\n }\n\n drawXAxis<XDomain extends AxisDomain, YDomain extends AxisDomain>(config: IPcacAxisBuilderConfig<XDomain, YDomain>) {\n if (config.xAxis.hide) return;\n config.svg.selectAll('.pcac-x-axis').remove();\n\n const xAxis = axisBottom(config.xScale).ticks(config.xAxis.ticks);\n if (config.xAxis.tickSize !== undefined) {\n xAxis.tickSizeInner(config.xAxis.tickSize);\n }\n\n switch (config.xAxis.format) {\n case PcacFormatEnum.Percentage:\n xAxis.tickFormat(d => d + \"%\");\n break;\n case PcacFormatEnum.Minutes:\n xAxis.tickFormat((d) => d + 'm');\n break;\n case PcacFormatEnum.Fahrenheit:\n xAxis.tickFormat((d) => d + ' F');\n break;\n case PcacFormatEnum.OneDayHours:\n xAxis.tickFormat((d) => {\n const h = d as number;\n const hour = h % 12 === 0 ? 12 : h % 12;\n const period = h < 12 ? 'am' : 'pm';\n return `${hour}${period}`;\n });\n break;\n case PcacFormatEnum.Decimal:\n xAxis.tickFormat((d) => format(\".2s\")(d as number));\n break;\n }\n\n const group = config.svg.append('g')\n .attr('class', 'pcac-x-axis')\n .attr('pointer-events', 'none')\n .classed('pcac-axis-tick-marks', config.xAxis.tickSize !== undefined)\n .classed('pcac-axis-line', config.xAxis.showLine)\n .attr('transform', 'translate(0,' + config.height + ')')\n .call(xAxis);\n\n this.drawLabels(group, config.xAxis, { length: config.width, outer: config.margin.bottom, vertical: false });\n }\n\n /**\n * The axis `label` and `subLabels`. Both are placed by two distances: along the axis (0 at its\n * start, `length` at its end - for the y axis, 0 is the bottom) and out from it, toward the\n * chart's edge. The label goes at the very edge (`outer`, i.e. the margin), the sub-label row\n * `PCAC_AXIS_LABEL_SPACE` inside that when there's a label. For the y axis the text is rotated\n * to read bottom-to-top, which swaps the two: after `rotate(-90)` x runs up the axis (so the\n * bottom is x = -length) and y runs left. `fill` is set explicitly because d3-axis puts\n * `fill=\"none\"` on the group; its own tick text does the same.\n */\n private drawLabels(\n group: Selection<SVGGElement, unknown, BaseType, unknown>,\n axis: PcacResolvedAxisConfig,\n layout: { length: number; outer: number; vertical: boolean }\n ): void {\n const text = (cls: string, along: number, out: number, anchor: string, content: string) => {\n group.append('text')\n .attr('class', cls)\n .attr('fill', 'currentColor')\n .attr('text-anchor', anchor)\n .attr('transform', layout.vertical ? 'rotate(-90)' : null)\n .attr('x', layout.vertical ? along - layout.length : along)\n .attr('y', layout.vertical ? -out : out)\n .attr('dy', layout.vertical ? '1em' : '-0.35em')\n .text(content);\n };\n\n if (axis.label) {\n text('pcac-axis-label', layout.length / 2, layout.outer, 'middle', axis.label);\n }\n const sub = axis.subLabels;\n if (sub) {\n const edge = layout.outer - (axis.label ? PCAC_AXIS_LABEL_SPACE : 0);\n if (sub.min) text('pcac-axis-sub-label', 0, edge, 'start', sub.min);\n if (sub.mid) text('pcac-axis-sub-label', layout.length / 2, edge, 'middle', sub.mid);\n if (sub.max) text('pcac-axis-sub-label', layout.length, edge, 'end', sub.max);\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BaseType, Selection } from 'd3-selection';\nimport { AxisScale, AxisDomain } from 'd3-axis';\n\n/**\n * Generic over each axis's own domain type, same rationale as `IPcacAxisBuilderConfig`.\n */\nexport interface IPcacGridBuilderConfig<XDomain extends AxisDomain = AxisDomain, YDomain extends AxisDomain = AxisDomain> {\n svg: Selection<SVGGElement, unknown, BaseType, unknown>;\n /**\n * Required for horizontal grid\n */\n width: number;\n /**\n * Required for vertical grid\n */\n height: number;\n xScale: AxisScale<XDomain>;\n yScale: AxisScale<YDomain>;\n /**\n * Tick count hint for a continuous scale (D3's `ticks(n)`); a category (band) scale ignores it\n * and gets one line per category.\n */\n numberOfTicks: number;\n}\n\n/**\n * `AxisScale` (the shape shared by every D3 scale usable here) doesn't declare `.ticks()` -\n * band scales don't have one - nor `.bandwidth()`, which only band scales have. Either kind can\n * drive a grid: a continuous scale puts a line at each tick, a band scale one through the middle\n * of each category, so `gridLines()` sniffs for `.ticks` and handles both.\n */\ntype TickableAxisScale<Domain extends AxisDomain> = AxisScale<Domain> & { ticks(count?: number): Domain[] };\ntype BandAxisScale<Domain extends AxisDomain> = AxisScale<Domain> & { bandwidth(): number };\n\n/** Where along its axis each grid line sits, in pixels. */\nfunction gridLines<Domain extends AxisDomain>(scale: AxisScale<Domain>, numberOfTicks: number): number[] {\n if (typeof (scale as TickableAxisScale<Domain>).ticks === 'function') {\n return (scale as TickableAxisScale<Domain>).ticks(numberOfTicks).map(d => scale(d) ?? 0);\n }\n const band = scale as BandAxisScale<Domain>;\n const half = typeof band.bandwidth === 'function' ? band.bandwidth() / 2 : 0;\n return scale.domain().map(d => (scale(d) ?? 0) + half);\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PcacGridBuilder {\n /**\n * Vertical lines, one per x-axis tick (or category), running the plot's full height. The group\n * is classed `pcac-grid-vertical` so a chart can find and redraw just this grid - the\n * line/area/plot charts do on zoom, when the x ticks move.\n */\n drawVerticalGrid<XDomain extends AxisDomain, YDomain extends AxisDomain>(config: IPcacGridBuilderConfig<XDomain, YDomain>): void {\n config.svg.append('g')\n .attr('class', 'pcac-grid pcac-grid-vertical')\n .selectAll('g.rule')\n .data(gridLines(config.xScale, config.numberOfTicks))\n .enter().append('svg:g')\n .attr('class', 'pcac-grid-rule')\n .attr('transform', (x): string => (`translate(${x}, 0)`))\n .append('svg:line')\n .attr('y1', 0)\n .attr('y2', config.height)\n .attr('class', (d, i: number) => (i === 0 ? 'pcac-grid-rule-last' : ''));\n }\n\n /**\n * Horizontal lines, one per y-axis tick (or category), running the plot's full width.\n */\n drawHorizontalGrid<XDomain extends AxisDomain, YDomain extends AxisDomain>(config: IPcacGridBuilderConfig<XDomain, YDomain>): void {\n config.svg.append('g')\n .attr('class', 'pcac-grid pcac-grid-horizontal')\n .selectAll('g.pcac-grid-rule')\n .data(gridLines(config.yScale, config.numberOfTicks))\n .enter().append('svg:g')\n .attr('class', 'pcac-grid-rule')\n .append('svg:line')\n .attr('y1', (y) => y)\n .attr('y2', (y) => y)\n .attr('x1', 0)\n .attr('x2', config.width)\n .attr('class', (_, i) => (i === 0 ? 'pcac-grid-rule-last' : ''));\n }\n}\n","import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PcacColorService {\n private primary = '#43425d';\n private primaryLight = '#a3a1fb';\n private success = '#5ee2a0';\n private danger = '#ff6565';\n private warning = '#fec163';\n private orange = '#ffa177';\n private blue = '#55d8fe';\n private scale = [\n this.primaryLight,\n this.success,\n this.danger,\n this.warning,\n this.orange,\n this.blue\n ] as string[];\n private alert = 'red';\n\n /**\n * Get a scale of colors dynamically\n * @param numberOfNodes Number of items in dynamically build collection of colors\n */\n getColorScale(numberOfNodes: number): string[] {\n const pallette = [] as string[];\n for (let i = 0; i < numberOfNodes; i++) {\n const mark = i % this.scale.length;\n pallette.push(this.scale[mark]);\n }\n return pallette;\n }\n\n getAlert(): string {\n return this.alert;\n }\n\n /**\n * Set the scale that charts use to set colors of data[x] on the UI.\n * @param colors A collection of hex values\n */\n setScale(colors: string[]): void {\n this.scale = colors;\n }\n\n setPrimary(color: string): void {\n this.primary = color;\n }\n\n setPrimaryLight(color: string): void {\n this.primaryLight = color;\n }\n\n setSuccess(color: string): void {\n this.success = color;\n }\n\n setDanger(color: string): void {\n this.danger = color;\n }\n\n setOrange(color: string): void {\n this.orange = color;\n }\n\n setBlue(color: string): void {\n this.blue = color;\n }\n\n setAlert(color: string): void {\n this.alert = color;\n }\n}\n","import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PcacTransitionService {\n private transitionDuration = 750;\n\n getTransitionDuration(): number {\n return this.transitionDuration;\n }\n}\n","import { ApplicationRef, EmbeddedViewRef, Injectable, TemplateRef, inject } from '@angular/core';\nimport { PcacData, PcacFormatEnum } from './chart.model';\nimport { PcacTooltipContext } from './tooltip.directive';\nimport { select } from 'd3';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PcacTooltipBuilder {\n private appRef = inject(ApplicationRef);\n\n /**\n * One tooltip element shared by every chart on the page, appended to `<body>` so it can float\n * over anything. It's only ever a positioning shell: the default look (`.pcac-d3-tooltip-default`)\n * is toggled on when the library renders its own key/value content and off when a consumer's\n * `<ng-template pcacTooltip>` is rendered into it instead, so a custom template owns the whole box.\n */\n public tooltip = select('body')\n .append('div')\n .attr('class', 'pcac-d3-tooltip');\n\n /**\n * The consumer template currently rendered into the shell, if any. Created on the first show\n * of a hover and torn down in `hideTooltip()` - not kept around between hovers - so a view is\n * never left holding onto a declaring component that has since been destroyed (e.g. after a\n * route change). While it lives, repeated `mousemove`s just update its context in place.\n */\n private view: EmbeddedViewRef<PcacTooltipContext> | null = null;\n private viewTemplate: TemplateRef<PcacTooltipContext> | null = null;\n\n /**\n * Shows the tooltip for a hovered datum at the event's position. Renders `template` when the\n * chart has one projected; otherwise falls back to the default key/value content, formatted per\n * `valueFormat`/`keyFormat`.\n */\n showTooltip(\n event: MouseEvent,\n template: TemplateRef<PcacTooltipContext> | undefined,\n context: PcacTooltipContext,\n valueFormat?: PcacFormatEnum,\n keyFormat?: PcacFormatEnum\n ): void {\n if (template) {\n this.renderTemplate(template, context);\n } else {\n this.renderDefault(context.$implicit, valueFormat, keyFormat);\n }\n this.position(event);\n }\n\n /**\n * @deprecated Builders should call `PcacChart.showTooltip()`, which routes through a chart's\n * projected `pcacTooltip` template. This only ever renders the default content.\n */\n showBarTooltip(event: MouseEvent, data: PcacData, valueFormat?: PcacFormatEnum, keyFormat?: PcacFormatEnum): void {\n this.showTooltip(event, undefined, { $implicit: data, parent: null, isThreshold: false, index: 0, parentIndex: null }, valueFormat, keyFormat);\n }\n\n hideTooltip(): void {\n this.tooltip.style('display', 'none');\n this.destroyView();\n }\n\n private renderDefault(data: PcacData, valueFormat?: PcacFormatEnum, keyFormat?: PcacFormatEnum): void {\n this.destroyView();\n this.tooltip\n .classed('pcac-d3-tooltip-default', true)\n .html(this.getBarTipData(data, valueFormat, keyFormat));\n }\n\n private renderTemplate(template: TemplateRef<PcacTooltipContext>, context: PcacTooltipContext): void {\n if (this.view && this.viewTemplate === template) {\n // Same hover, new mouse position/datum: keep the view and just refresh what it's bound to.\n Object.assign(this.view.context, context);\n } else {\n this.destroyView();\n this.tooltip.classed('pcac-d3-tooltip-default', false).html(null);\n\n // Same technique as the CDK's DomPortalOutlet: create the view off-tree, attach it to the\n // app so it takes part in change detection (a template reading a signal keeps updating\n // while shown), then physically move its nodes into the shell. The view's own injector is\n // the declaring component's, so pipes/DI in the template resolve as they would in place.\n this.view = template.createEmbeddedView(context);\n this.viewTemplate = template;\n this.appRef.attachView(this.view);\n const shell = this.tooltip.node() as HTMLDivElement;\n for (const node of this.view.rootNodes) {\n shell.appendChild(node);\n }\n }\n // The trigger is a D3-native mouse listener, which nothing in Angular observes under zoneless\n // change detection, so the view has to be checked explicitly for the new context to render\n // before it's measured for positioning.\n this.view.detectChanges();\n }\n\n private destroyView(): void {\n if (!this.view) {\n return;\n }\n // `destroy()` also detaches the view from the ApplicationRef it was attached to, but it\n // doesn't pull the nodes we moved into the shell back out of the DOM - that's what a\n // ViewContainerRef would normally do on removal - so the shell is emptied here explicitly.\n this.view.destroy();\n this.view = null;\n this.viewTemplate = null;\n this.tooltip.html(null);\n }\n\n /**\n * Centers the (already rendered) tooltip horizontally on the cursor and sits it just above.\n * Measured from the real box rather than fixed offsets so it works for content of any size.\n */\n private position(event: MouseEvent): void {\n const shell = this.tooltip.style('display', 'inline-block').node() as HTMLDivElement;\n this.tooltip\n .style('left', event.pageX - shell.offsetWidth / 2 + 'px')\n .style('top', event.pageY - shell.offsetHeight - 8 + 'px');\n }\n\n private getBarTipData(data: PcacData, valueFormat?: PcacFormatEnum, keyFormat?: PcacFormatEnum): string | null {\n let value = data.value;\n let key = data.key\n\n if (valueFormat) {\n switch (valueFormat) {\n case PcacFormatEnum.Percentage:\n value = value as number * 100 + '%';\n break;\n case PcacFormatEnum.Fahrenheit:\n value = `${value} F`;\n break;\n }\n }\n\n if (key && keyFormat) {\n switch (keyFormat) {\n case PcacFormatEnum.DateTime:\n key = new Date(key).toLocaleDateString('en-US', {\n day: '2-digit',\n month: '2-digit',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit'\n })\n break;\n }\n }\n\n const finalValue = value ? value.toString() : value;\n\n return key ? key + '<br>' + finalValue : `${finalValue}`;\n }\n}\n","import { axisLeft, AxisDomain, AxisScale } from 'd3-axis';\nimport { BaseType, Selection } from 'd3-selection';\nimport { IPcacAxisBuilderConfig, PcacAxisBuilder } from './axis.builder';\nimport { PcacGridBuilder } from './grid.builder';\nimport { PcacColorService } from './color.service';\nimport { select } from 'd3-selection';\nimport { ElementRef, TemplateRef, inject } from '@angular/core';\nimport { PCAC_AXIS_LABEL_SPACE, PCAC_AXIS_SUB_LABEL_SPACE, PcacAxisChartConfig, PcacChartConfig, PcacChartMargin, PcacData, PcacFormatEnum, PcacResolvedAxisConfig, axisLabelSpace, resolveAxisConfig } from './chart.model';\nimport { PcacTransitionService } from './transition.service';\nimport { PcacTooltipBuilder } from './tooltip.builder';\nimport { PcacTooltipContext } from './tooltip.directive';\n\n/**\n * Everything `showTooltip()` needs beyond the hovered datum itself. `parent`/`isThreshold` feed\n * the consumer template's context; the formats only apply to the default (no template) content.\n */\nexport interface PcacTooltipOptions {\n /** See `PcacTooltipContext.index`. Required so no hover site can forget to supply it. */\n index: number;\n parent?: PcacData | null;\n /** See `PcacTooltipContext.parentIndex`. Defaults to `null`, matching `parent`'s default. */\n parentIndex?: number | null;\n isThreshold?: boolean;\n valueFormat?: PcacFormatEnum;\n keyFormat?: PcacFormatEnum;\n}\n\n\nexport class PcacChart {\n axisBuilder = inject(PcacAxisBuilder);\n gridBuilder = inject(PcacGridBuilder);\n transitionService = inject(PcacTransitionService);\n tooltipBuilder = inject(PcacTooltipBuilder);\n colorService = inject(PcacColorService);\n\n /** D3's own `tickSizeInner` default, which the default `margin` below is sized around. */\n static readonly DEFAULT_TICK_SIZE = 6;\n\n /** See `PCAC_AXIS_LABEL_SPACE` / `PCAC_AXIS_SUB_LABEL_SPACE` in chart.model.ts. */\n static readonly AXIS_LABEL_SPACE = PCAC_AXIS_LABEL_SPACE;\n static readonly AXIS_SUB_LABEL_SPACE = PCAC_AXIS_SUB_LABEL_SPACE;\n\n margin: PcacChartMargin = { top: 8, right: 16, bottom: 20, left: 40 };\n private readonly defaultMargin: PcacChartMargin = { ...this.margin };\n\n /**\n * The current build's per-axis settings with defaults applied, set by `initializeAxisState()`.\n * Builders read these (not the raw `config.xAxis`) everywhere: drawing the axes, choosing\n * whether to draw a grid, how many grid lines, and so on. Pie has no axes and never sets them.\n */\n xAxis: PcacResolvedAxisConfig = resolveAxisConfig();\n yAxis: PcacResolvedAxisConfig = resolveAxisConfig();\n svg!: Selection<SVGGElement, unknown, BaseType, unknown>;\n width = 400;\n height = 400;\n colors = [] as string[];\n startData: PcacData[] = [];\n\n /**\n * Raw, unadjusted container width measured by the last successful `initializeChartState()`\n * call, or `null` if none has succeeded yet. Deliberately tracked separately from `width`:\n * some builders (e.g. bar-horizontal-chart's `setHorizontalMarginsBasedOnContent`) recompute\n * `width`/`margin.left` mid-build from measured axis-label sizes, so `width` alone isn't a\n * stable basis for \"did the container itself resize\" — the raw container measurement is.\n */\n private lastContainerWidth: number | null = null;\n\n /**\n * Raw container height measured by the last successful `initializeChartState()` call, and\n * whether that build was running with `heightFull` on. Only consulted by `containerSizeChanged`\n * when it was: without `heightFull` the container's height is driven *by* the chart's own SVG\n * height, so comparing it would report \"changed\" every time the chart itself grew or shrank.\n */\n private lastContainerHeight: number | null = null;\n private lastHeightFull = false;\n\n /**\n * How much the vertical margins have grown this build beyond their defaults - for tick marks\n * and axis labels (`initializeAxisState()`; negative when a short tick took some away) and for\n * content that hangs past the plot's edge (`reserveEdgeSpace()`). `resolveHeight()` subtracts\n * it from the plot height so the SVG's total height doesn't change with any of them. Reset\n * alongside the margins.\n */\n private reservedHeight = 0;\n\n /**\n * Resolves the consumer's projected `<ng-template pcacTooltip>`, if any. Each chart component\n * points this at its own `contentChild(PcacTooltipDirective)` query. It's a getter rather than\n * a captured value so it's read lazily, at hover time, from inside a D3 listener: reading the\n * query signal in the component's build effect instead would make the effect depend on it and\n * rebuild the whole chart (restarting its entry animation) whenever the query resolves.\n */\n tooltipTemplate: () => TemplateRef<PcacTooltipContext> | undefined = () => undefined;\n\n /**\n * Puts `margin` back to its defaults. `initializeAxisState()` calls this first thing, before any\n * per-build adjustment (hidden axes giving sides back, tick sizes growing them, label widths\n * measured into `margin.left`): `margin` lives on this per-chart instance and so persists\n * between builds, and without a reset an adjustment made for one config silently carries into\n * the next - e.g. axes drawn with no room after `hide` flips back to false.\n */\n resetMargin(): void {\n this.margin = { ...this.defaultMargin };\n this.reservedHeight = 0;\n }\n\n /**\n * Resolves the config's `xAxis`/`yAxis` onto this chart and sets the margins up for them. Axis\n * charts call this at the top of `buildChart()`, on their own copy of the config (it rewrites\n * `config.height` for hidden axes), before `initializeChartState()` measures the plot area.\n * In order:\n *\n * 1. `resetMargin()`.\n * 2. Tick marks: room for a non-default `tickSize` is reserved on each axis that will actually\n * be drawn (`reserveTickSizeMargins`).\n * 3. Labels: `AXIS_LABEL_SPACE` is added to `bottom` / `left` for an axis with a `label`, and\n * `AXIS_SUB_LABEL_SPACE` for one with any `subLabels` (see `axisLabelSpace`), again only if\n * the axis will be drawn.\n * 4. Hidden axes: an axis with `hide` gives its margins back to the plot. The y axis owns\n * `left` and `top` (the top margin is only there so the topmost y label isn't clipped), the\n * x axis `bottom` and `right` (likewise for the rightmost x label). Each reclaimed vertical\n * margin is added onto `config.height` so the SVG's total height stays what the consumer\n * configured; horizontally `initializeChartState()` picks the change up on its own.\n *\n * @param defaultGrid the axis whose grid this chart draws when the consumer hasn't said\n * (`PcacAxisConfig.showGrid`): `'y'` for horizontal lines, `'x'` for vertical.\n * @param hiddenAxisMargin what a hidden axis's sides shrink to, rather than 0. The\n * line/area/plot charts keep 8px so a dot on the edge of the plot isn't clipped by the SVG.\n */\n initializeAxisState(config: PcacAxisChartConfig, defaultGrid: 'x' | 'y', hiddenAxisMargin = 0): void {\n this.xAxis = resolveAxisConfig(config.xAxis, defaultGrid === 'x');\n this.yAxis = resolveAxisConfig(config.yAxis, defaultGrid === 'y');\n this.resetMargin();\n this.reserveTickSizeMargins(\n this.xAxis.hide ? undefined : this.xAxis.tickSize,\n this.yAxis.hide ? undefined : this.yAxis.tickSize\n );\n if (!this.xAxis.hide) {\n const space = axisLabelSpace(this.xAxis);\n this.margin.bottom += space;\n this.reservedHeight += space;\n }\n if (!this.yAxis.hide) {\n this.margin.left += axisLabelSpace(this.yAxis);\n }\n if (this.yAxis.hide) {\n config.height = config.height + this.margin.top - hiddenAxisMargin;\n this.margin.top = hiddenAxisMargin;\n this.margin.left = hiddenAxisMargin;\n }\n if (this.xAxis.hide) {\n config.height = config.height + this.margin.bottom - hiddenAxisMargin;\n this.margin.bottom = hiddenAxisMargin;\n this.margin.right = hiddenAxisMargin;\n }\n }\n\n /**\n * The `PcacAxisBuilder` config for this chart's current state - everything but the scales is\n * already on the instance. Builders pass the result to `drawAxis()` (or `drawXAxis()` with a\n * rescaled x, on zoom).\n */\n axisBuilderConfig<XDomain extends AxisDomain, YDomain extends AxisDomain>(\n xScale: AxisScale<XDomain>, yScale: AxisScale<YDomain>\n ): IPcacAxisBuilderConfig<XDomain, YDomain> {\n return {\n svg: this.svg,\n width: this.width,\n height: this.height,\n margin: this.margin,\n xScale,\n yScale,\n xAxis: this.xAxis,\n yAxis: this.yAxis\n };\n }\n\n /**\n * Draws whichever grids the resolved axes ask for: vertical lines from the x axis's ticks,\n * horizontal from the y's (`PcacAxisConfig.showGrid`). `which` restricts it to one axis - the\n * line/area/plot charts redraw just the x grid against the rescaled x on zoom.\n */\n drawGrids<XDomain extends AxisDomain, YDomain extends AxisDomain>(\n xScale: AxisScale<XDomain>, yScale: AxisScale<YDomain>, which: 'x' | 'y' | 'both' = 'both'\n ): void {\n const base = { svg: this.svg, width: this.width, height: this.height, xScale, yScale };\n if (which !== 'y' && this.xAxis.showGrid) {\n this.gridBuilder.drawVerticalGrid({ ...base, numberOfTicks: this.xAxis.ticks });\n }\n if (which !== 'x' && this.yAxis.showGrid) {\n this.gridBuilder.drawHorizontalGrid({ ...base, numberOfTicks: this.yAxis.ticks });\n }\n }\n\n /**\n * Makes room in the margins for tick marks longer (or shorter) than D3's default. The default\n * margins are sized around that default (`DEFAULT_TICK_SIZE`), and D3 places each tick label at\n * tick length + padding, so a longer tick pushes its labels outward by exactly the difference -\n * into space the margin doesn't have unless it grows by the same amount. Growing the margin here,\n * *before* `initializeChartState()` measures the plot area, is what makes the chart shrink to fit\n * its labels rather than pushing them off the edge of the SVG. A shorter tick hands the\n * difference back to the plot area the same way.\n *\n * Horizontally that happens on its own: `initializeChartState()` derives `width` from the\n * container minus the margins. Vertically it doesn't - `config.height` is the plot area, and\n * the SVG is that plus the margins - so a taller bottom margin would grow the SVG instead. The\n * delta is therefore also remembered in `reservedHeight` and taken back out of the plot\n * height by `resolveHeight()`, keeping the chart's total footprint where the consumer put it.\n *\n * Called by `initializeAxisState()` right after `resetMargin()`, for the axes that will be\n * drawn. Only the axis a tick size is given for is affected; `undefined` leaves that margin\n * alone.\n * @param xTickSize `tickSizeInner` for the bottom (x) axis, which lives in `margin.bottom`\n * @param yTickSize `tickSizeInner` for the left (y) axis, which lives in `margin.left`\n */\n reserveTickSizeMargins(xTickSize?: number, yTickSize?: number): void {\n if (xTickSize !== undefined) {\n const bottom = Math.max(0, this.margin.bottom + xTickSize - PcacChart.DEFAULT_TICK_SIZE);\n this.reservedHeight = bottom - this.margin.bottom;\n this.margin.bottom = bottom;\n }\n if (yTickSize !== undefined) {\n this.margin.left = Math.max(0, this.margin.left + yTickSize - PcacChart.DEFAULT_TICK_SIZE);\n }\n }\n\n /**\n * Makes sure each given margin is at least that big, for content drawn at the very edge of the\n * plot area that reaches past it - a point image on the line/area/plot charts, say, whose box\n * is centered on a point at the top of the y domain and so hangs half of itself above the plot.\n * Those charts already widen their clip-path to let such a point through; this is what stops\n * the `<svg>` itself from cutting it off, the SVG being only the plot area plus the margins.\n *\n * \"At least\", not \"add\": the default margins, and any tick / label room already reserved in\n * them, may well cover it already (`margin.left` is 40 by default), and adding on top of that\n * would give up plot area for nothing. Vertical growth is taken out of the plot height the same\n * way `reserveTickSizeMargins()`'s is, so the SVG's total height stays what the consumer\n * configured; horizontally `initializeChartState()` picks the change up on its own. A side\n * left `undefined` is untouched.\n *\n * Call after `initializeAxisState()` (which resets the margins) and before\n * `initializeChartState()` (which measures the plot area against them).\n */\n reserveEdgeSpace(space: Partial<PcacChartMargin>): void {\n for (const side of ['top', 'right', 'bottom', 'left'] as const) {\n const wanted = space[side];\n if (wanted === undefined || wanted <= this.margin[side]) {\n continue;\n }\n if (side === 'top' || side === 'bottom') {\n this.reservedHeight += wanted - this.margin[side];\n }\n this.margin[side] = wanted;\n }\n }\n\n /**\n * Shows the tooltip for a hovered datum, through the chart's `pcacTooltip` template when one is\n * projected and the default key/value content otherwise. Every builder's hover handler should\n * go through here rather than `tooltipBuilder` directly so the template is honored everywhere.\n */\n showTooltip(event: MouseEvent, data: PcacData, options: PcacTooltipOptions): void {\n this.tooltipBuilder.showTooltip(\n event,\n this.tooltipTemplate(),\n {\n $implicit: data,\n parent: options.parent ?? null,\n isThreshold: options.isThreshold ?? false,\n index: options.index,\n parentIndex: options.parentIndex ?? null,\n },\n options.valueFormat,\n options.keyFormat\n );\n }\n\n hideTooltip(): void {\n this.tooltipBuilder.hideTooltip();\n }\n\n /**\n * Prior to building a chart, we need to initialize the state of the chart.\n *\n * Returns `false` (and leaves `width`/`height`/`colors` untouched) if the container hasn't\n * been laid out yet, so its `clientWidth` measures 0 — this happens when a chart mounts\n * already holding data (e.g. behind a loading gate) and its first `ngOnChanges` fires before\n * the browser has committed layout for its own just-created DOM node. Callers should bail out\n * of their build on `false` rather than proceeding with a degenerate width; `PcacChartResizeService`\n * (wired up by every chart component) retries the build once the container has a real size.\n * @param chartElm Reference to SVG on dom\n * @param config Chart specific configuration\n */\n initializeChartState(chartElm: ElementRef, config: PcacChartConfig): boolean {\n select(chartElm.nativeElement).select('g').remove();\n const container = chartElm.nativeElement.parentNode as HTMLElement;\n const containerWidth = container.clientWidth;\n const measuredWidth = containerWidth - this.margin.left - this.margin.right;\n if (measuredWidth <= 0) {\n return false;\n }\n this.width = measuredWidth;\n this.height = this.resolveHeight(container, config);\n this.colors = this.colorService.getColorScale(Math.max(config.data.length, config.data[0]?.data ? config.data[0].data.length : 0));\n this.lastContainerWidth = containerWidth;\n this.lastContainerHeight = container.clientHeight;\n this.lastHeightFull = config.heightFull === true;\n return true;\n }\n\n /**\n * `config.height` normally *is* the height of the drawing area. With `config.heightFull` on it\n * becomes a floor instead: the chart fills its container, and only falls back to `config.height`\n * when the container is shorter than that (or has no definite height of its own to fill - see\n * `PcacChartConfig.heightFull`, where an auto-height container measures ~0 here and the\n * `Math.max` keeps the configured height).\n *\n * Note this deliberately subtracts the margins, so it's the *total* SVG that ends up matching\n * the container: `buildContainer()` adds `margin.top`/`margin.bottom` back on top of `height`\n * when sizing the `<svg>`, so filling without this would overflow the container by exactly the\n * vertical margins.\n * @param container The chart's container element (the `<svg>`'s parent)\n * @param config Chart specific configuration\n */\n private resolveHeight(container: HTMLElement, config: PcacChartConfig): number {\n // See `reserveTickSizeMargins()` / `reserveEdgeSpace()`: room made in the vertical margins\n // comes out of the plot area, not added on to the SVG. Applies to the floor in the `heightFull`\n // case too, for the same reason.\n const height = Math.max(0, config.height - this.reservedHeight);\n if (!config.heightFull) {\n return height;\n }\n return Math.max(height, container.clientHeight - this.margin.top - this.margin.bottom);\n }\n\n /**\n * True if the container's current raw layout width differs from the one measured by the last\n * successful build, or if no successful build has happened yet. For a `heightFull` chart, a\n * change in the container's height counts too - that's the whole size the chart is tracking.\n *\n * `PcacChartResizeService`'s `ResizeObserver` is guaranteed to fire once as soon as it starts\n * observing — that's what lets a chart recover from the 0-width race described on\n * `initializeChartState`, but it also means that \"routine\" first callback usually lands\n * moments after `ngOnChanges` already built successfully at the same width. Without this\n * check, that redundant callback would restart the chart's enter transition mid-animation for\n * no visual change. Only `ngOnChanges` (which reacts to data, not size) should skip this check.\n * @param chartElm Reference to SVG on dom\n */\n containerSizeChanged(chartElm: ElementRef): boolean {\n if (this.lastContainerWidth === null) {\n return true;\n }\n const container = chartElm.nativeElement.parentNode as HTMLElement;\n const containerWidth = container.clientWidth;\n if (containerWidth > 0 && containerWidth !== this.lastContainerWidth) {\n return true;\n }\n if (!this.lastHeightFull) {\n return false;\n }\n // Height only matters for a `heightFull` chart, and only there is it safe to compare: the\n // container's height is definite (see `resolveHeight`), so it changes when the *layout*\n // changes, not in response to the height this chart just drew itself at.\n const containerHeight = container.clientHeight;\n return containerHeight > 0 && containerHeight !== this.lastContainerHeight;\n }\n\n /**\n * 1) Set the width and height of the SVG\n * 2) Add a group and translate it to state of {{center}} option\n * @param chartElm Reference to SVG on dom\n * @param center Are we pinning x,y to the top,left, or are we centering our drawing group inside the SVG.\n */\n buildContainer(chartElm: ElementRef, center = false): void {\n const combinedHeight = this.height + this.margin.top + this.margin.bottom;\n const combinedWidth = this.width + this.margin.left + this.margin.right;\n this.svg = select(chartElm.nativeElement)\n .attr('width', combinedWidth)\n .attr('height', combinedHeight);\n if (center) {\n this.svg = this.svg\n .append('g')\n .attr('transform', 'translate(' + combinedWidth / 2 + ',' + combinedHeight / 2 + ')');\n return;\n }\n this.svg = this.svg\n .append('g')\n .attr('transform', 'translate(' + this.margin.left + ',' + this.margin.top + ')');\n }\n\n /**\n * Most charts share a default margin(s) state.\n * In some cases, that state needs to be calculated based on the content that resides in that margin.\n * For example, labels on a horizontal bar chart are dynamic and such the margin needs to be calculated ahead of\n * chart axis construction.\n *\n * Measures with the y axis's own `tickSize` (the measured box spans the tick line as well as\n * the label, so measuring at a different length would put the labels off by the difference)\n * and adds its `axisLabelSpace()` back on top, since the measurement replaces whatever\n * `initializeAxisState()` reserved for the label / sub labels.\n * @param chartElm Reference to SVG on dom\n * @param yScale D3 scale transformation object (d3.ScaleBand)\n */\n setHorizontalMarginsBasedOnContent<Domain extends AxisDomain>(chartElm: ElementRef, yScale: AxisScale<Domain>): void {\n const axisY = axisLeft(yScale).ticks(5);\n if (this.yAxis.tickSize !== undefined) {\n axisY.tickSizeInner(this.yAxis.tickSize);\n }\n let max = 0;\n select(chartElm.nativeElement).append('g')\n .call(axisY)\n .each((d, i, n) => {\n const width = (n[i] as SVGGraphicsElement).getBBox().width;\n if (width > max) {\n max = width;\n }\n })\n .remove();\n // `width` was already computed net of the current `margin.left` by initializeChartState(),\n // so only the *change* in margin comes out of it. Subtracting the whole measured margin\n // double-counted it, and since `margin` persists on the builder between builds, the amount\n // double-counted grew on the next rebuild - the plot area came out narrower than the\n // container allowed and then shrank further after the first resize.\n const left = max + axisLabelSpace(this.yAxis);\n this.width = this.width + this.margin.left - left;\n this.margin.left = left;\n }\n}\n","import { PcacData } from './chart.model';\n\n/**\n * Where each bar of a stacked group starts: the running total of the bars before it, in data\n * order, so the first bar sits on the baseline and each later one on top of the previous. Values\n * are the bar's *own* size (segment), not a pre-accumulated total; a null value counts as 0.\n *\n * Keyed by the bar's own `PcacData` object so D3 callbacks (which only get the datum) can look\n * their offset up directly.\n */\nexport function stackStarts(groups: PcacData[]): Map<PcacData, number> {\n const starts = new Map<PcacData, number>();\n for (const group of groups) {\n let total = 0;\n for (const bar of group.data) {\n starts.set(bar, total);\n total += Number(bar.value ?? 0);\n }\n }\n return starts;\n}\n","import { Injectable, ElementRef } from '@angular/core';\nimport { color } from 'd3-color';\nimport { scaleBand, ScaleBand, scaleLinear, ScaleLinear } from 'd3-scale';\nimport { select, Selection } from 'd3-selection';\nimport { BaseType } from 'd3-selection';\nimport { Subject } from 'rxjs';\n\n/**\n * Lib\n */\nimport { PcacBarHorizontalChartConfig } from './bar-horizontal-chart.model';\nimport { PcacChart } from '../../core/chart';\nimport { PcacData } from '../../core/chart.model';\nimport { stackStarts } from '../../core/stack';\n\n// `BaseType` (not the hand-rolled union this used to be, which omitted `null` and never\n// actually matched what `.selectAll()`'s default generics resolve to).\ntype GroupType = Selection<BaseType, PcacData, BaseType, PcacData>;\n\n/**\n * Provided per-component (see PcacBarHorizontalChartComponent's `providers`), not root-scoped:\n * this builder extends PcacChart, which holds mutable per-chart-instance state (margin, width,\n * height, colors, svg). A root singleton would be shared and clobbered by every\n * <pcac-bar-horizontal-chart> rendered at once.\n */\n@Injectable()\nexport class BarHorizontalChartBuilder extends PcacChart {\n private xScale!: ScaleLinear<number, number>;\n private yScaleStacked!: ScaleBand<string>;\n private yScaleGrouped!: ScaleBand<string>;\n private barClickedSource = new Subject<PcacData>();\n private config!: PcacBarHorizontalChartConfig;\n barClicked$ = this.barClickedSource.asObservable();\n\n buildChart(chartElm: ElementRef, config: PcacBarHorizontalChartConfig): void {\n if (!config?.data?.length) {\n return;\n }\n\n this.config = JSON.parse(JSON.stringify(config));\n this.initializeAxisState(this.config, 'x');\n if (!this.initializeChartState(chartElm, this.config)) {\n return;\n }\n\n // Copy before reversing: `.reverse()` is in place, and this is the consumer's own array -\n // reversing it directly flipped their palette on every rebuild (i.e. every resize).\n if (config.colorOverride && config.colorOverride.colors) {\n this.colors = [...config.colorOverride.colors].reverse();\n }\n this.buildScales(chartElm, this.config);\n this.drawChart(chartElm, this.config);\n }\n\n private buildScales(chartElm: ElementRef, config: PcacBarHorizontalChartConfig) {\n config.data[0].data.map((d) => {\n return d.value;\n });\n\n // Bars grow from 0, so only `domainMax` is read; `xAxis.domainMin` is ignored.\n this.xScale = scaleLinear()\n .domain([0, this.xAxis.domainMax as number]);\n\n\n this.yScaleStacked = scaleBand()\n .domain(config.data.map((d) => d.key as string))\n .range([this.height, 0])\n .padding(0.1);\n\n this.yScaleGrouped = scaleBand()\n .padding(0.05)\n .rangeRound([0, this.yScaleStacked.bandwidth()])\n .domain(config.data[0].data.map((d) => d.key as string));\n\n // The left margin is sized to the y axis's labels - unless there is no y axis to size it to\n if (!this.yAxis.hide) {\n this.setHorizontalMarginsBasedOnContent(chartElm, this.yScaleStacked);\n }\n\n this.xScale.range([0, this.width]);\n }\n\n private drawChart(chartElm: ElementRef, config: PcacBarHorizontalChartConfig): void {\n this.buildContainer(chartElm);\n this.axisBuilder.drawAxis(this.axisBuilderConfig(this.xScale, this.yScaleStacked));\n this.drawGrids(this.xScale, this.yScaleStacked);\n this.addGroups(config);\n this.axisBuilder.raiseAxes(this.svg);\n }\n\n private addGroups(config: PcacBarHorizontalChartConfig) {\n const groupsContainer = this.svg.append('g')\n .attr('class', 'pcac-bars')\n .selectAll('g')\n .data(config.data)\n .enter().append('g')\n .attr('class', 'pcac-bar-group')\n .attr('data-group-id', (d: PcacData, i: number) => {\n return i;\n })\n .attr('transform', (d: PcacData) => 'translate(0,' + this.yScaleStacked(d.key as string) + ')');\n\n const group = groupsContainer.selectAll('rect')\n .data((d: PcacData) => {\n return d.data;\n });\n\n this.drawBarsPerGroup(group, config);\n\n // We have no thresholds to draw\n if (!config.thresholds) {\n return;\n }\n\n // Draw threshold across entire chart\n if (config.thresholds.length === 1 && !config.thresholds[0].data) {\n this.drawThresholdAcrossChart(config);\n }\n\n // Draw threshold across each group\n if (config.thresholds.length > 1 && (!config.thresholds[0].data || config.isStacked)) {\n this.drawThresholdsPerGroup(group, config);\n }\n\n // Draw threshold across each bar in group\n if (config.thresholds.length > 1 && config.thresholds[0].data && !config.isStacked) {\n this.drawThresholdsPerBarInGroup(group, config);\n }\n }\n\n private drawBarsPerGroup(groups: GroupType, config: PcacBarHorizontalChartConfig) {\n const self = this;\n // Stacked bars start where the previous bar in their group ends; every other layout draws\n // from the baseline (start 0).\n const starts = config.isStacked ? stackStarts(config.data) : new Map<PcacData, number>();\n const startOf = (d: PcacData) => starts.get(d) ?? 0;\n const endOf = (d: PcacData) => startOf(d) + Number(d.value ?? 0);\n groups.enter().append('rect')\n .attr('class', 'pcac-bar')\n .attr('x', (d: PcacData) => this.xScale(startOf(d)))\n .attr('y', (d: PcacData) => {\n const value = !config.isStacked ? this.yScaleGrouped(d.key as string) : this.yScaleStacked(d.key as string)\n return value ? value : 0;\n })\n .attr('data-group-bar-id', (_: PcacData, i: number) => {\n return i;\n })\n .attr('height', !config.isStacked ? this.yScaleGrouped.bandwidth() : this.yScaleStacked.bandwidth())\n .style('fill', (d: PcacData, i: number, n: any) => {\n if (config.spreadColorsPerGroup) {\n const groupIndex = parseInt(n[0].parentNode.getAttribute('data-group-id'), 10);\n return this.colors[groupIndex];\n }\n return this.colors[i];\n })\n .attr('width', 0)\n .on('mouseover', function (this: any) {\n select(this)\n .transition()\n .duration(self.transitionService.getTransitionDuration() / 7.5)\n .style('fill', () => {\n if (config.spreadColorsPerGroup) {\n const groupIndex = parseInt(this.parentNode.getAttribute('data-group-id'), 10);\n const c = color(self.colors[groupIndex])\n const ct = c ? c.darker(1).toString() : self.colors[groupIndex]\n return ct\n }\n const groupIndex = parseInt(this.getAttribute('data-group-bar-id'), 10);\n const c = color(self.colors[groupIndex])\n const ct = c ? c.darker(1).toString() : self.colors[groupIndex]\n return ct\n });\n })\n .on('mousemove', function (this: SVGRectElement, event: MouseEvent, d: PcacData) {\n const groupIndex = Number((this.parentNode as Element).getAttribute('data-group-id'));\n const index = Number(this.getAttribute('data-group-bar-id'));\n self.showTooltip(event, d, { index, parent: config.data[groupIndex], parentIndex: groupIndex, valueFormat: self.xAxis.format });\n })\n .on('mouseout', function (this: any) {\n self.hideTooltip();\n select(this)\n .transition()\n .duration(self.transitionService.getTransitionDuration() / 5)\n .style('fill', () => {\n if (config.spreadColorsPerGroup) {\n const groupIndex = parseInt(this.parentNode.getAttribute('data-group-id'), 10);\n return self.colors[groupIndex];\n }\n const groupIndex = parseInt(this.getAttribute('data-group-bar-id'), 10);\n return self.colors[groupIndex];\n });\n })\n .on('click', (_event: MouseEvent, d: PcacData) => {\n this.barClickedSource.next(d);\n })\n .transition()\n .duration(this.transitionService.getTransitionDuration())\n .attr('width', (d: PcacData) => {\n return this.xScale(endOf(d)) - this.xScale(startOf(d));\n });\n }\n\n private drawThresholdAcrossChart(config: PcacBarHorizontalChartConfig) {\n this.applyPreTransitionThresholdStyles(this.svg.select('.pcac-bars').append('rect'))\n .attr('height', this.height)\n .attr('data-group-threshold-id', (_: unknown, i: number) => {\n return i;\n })\n .on('mousemove', (event: MouseEvent) => {\n this.showTooltip(event, config.thresholds[0], { index: 0, isThreshold: true, valueFormat: this.xAxis.format });\n })\n .transition()\n .duration(this.transitionService.getTransitionDuration())\n .attr('x', (_: unknown, i: number) => {\n return this.xScale(config.thresholds[i].value as number);\n });\n }\n\n private drawThresholdsPerGroup(group: GroupType, config: PcacBarHorizontalChartConfig) {\n const self = this\n this.applyPreTransitionThresholdStyles(this.svg.selectAll('.pcac-bar-group').append('rect'))\n .attr('height', this.yScaleStacked.bandwidth())\n .attr('data-group-threshold-id', (_: unknown, i: number) => {\n return i;\n })\n .on('mousemove', function (this: any, event: MouseEvent) {\n const index = Number(this.parentElement.dataset['groupId'])\n const threshold = config.thresholds[index];\n // A threshold's own PcacData is typically just a value, so its parent is the *data* group\n // it's drawn against (which has the key) rather than the threshold entry it came from.\n self.showTooltip(\n event,\n config.isStacked ? threshold.data[0] : threshold,\n { index, parent: config.data[index], parentIndex: index, isThreshold: true, valueFormat: self.xAxis.format }\n );\n })\n .transition()\n .duration(this.transitionService.getTransitionDuration())\n .attr('x', (_: unknown, i: number) => {\n return this.xScale(config.isStacked ? config.thresholds[i].data[0].value as number : config.thresholds[i].value as number);\n });\n }\n\n private drawThresholdsPerBarInGroup(group: GroupType, config: PcacBarHorizontalChartConfig) {\n const self = this\n this.applyPreTransitionThresholdStyles(group.enter().append('rect'))\n .attr('data-group-threshold-id', (_: PcacData, i: number) => {\n return i;\n })\n .attr('height', this.yScaleGrouped.bandwidth())\n .on('mousemove', function (this: any, event: MouseEvent) {\n const target = event.target as Element\n const index = Number(target.getAttribute(\"data-group-threshold-id\"))\n const groupIndex = Number(this.parentElement.dataset['groupId'])\n // Parent is the data group (see drawThresholdsPerGroup), not the threshold entry itself.\n self.showTooltip(\n event,\n config.thresholds[groupIndex].data[index],\n { index, parent: config.data[groupIndex], parentIndex: groupIndex, isThreshold: true, valueFormat: self.xAxis.format }\n );\n })\n .transition()\n .duration(this.transitionService.getTransitionDuration())\n .attr('y', (d: PcacData) => {\n // ScaleBand can return undefined for a key outside its domain; `.attr()` needs null, not undefined.\n return this.yScaleGrouped(d.key as string) ?? null;\n })\n .attr('x', (d: PcacData, i: number, n: any) => {\n return this.xScale(config.thresholds[n[0].parentElement.dataset['groupId']].data[i].value as number);\n });\n }\n\n private applyPreTransitionThresholdStyles<S extends Selection<any, any, any, any>>(elm: S): S {\n return elm.attr('class', 'pcac-threshold')\n .style('fill', () => {\n return this.colorService.getAlert();\n })\n .style('stroke', () => {\n return this.colorService.getAlert();\n })\n .style('stroke-width', () => {\n return 2;\n })\n .attr('width', '3px')\n .on('mouseout', () => {\n this.hideTooltip();\n });\n }\n}\n","import { DestroyRef, ElementRef, Injectable, Signal, afterNextRender, inject } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { Subject } from 'rxjs';\nimport { debounceTime } from 'rxjs/operators';\n\n/**\n * Rebuilds a chart whenever its container's real, laid-out size changes.\n *\n * A plain `window:resize` listener (the previous approach) misses any layout-driven size change\n * that isn't a viewport resize — a sidebar collapsing, a tab becoming active, a flex/grid reflow.\n * It also can't help a chart that mounts already holding data (e.g. behind a loading gate): that\n * chart's first `ngOnChanges` can fire before the browser has committed layout for its own\n * just-created DOM node, so `PcacChart.initializeChartState()` measures a 0-width container and\n * bails out with nothing drawn — and with no resize ever firing, nothing retries it.\n *\n * `ResizeObserver`'s callback contract guarantees real, laid-out dimensions on every firing,\n * including its first, so observing the container naturally retries that exact case.\n */\n@Injectable({ providedIn: 'root' })\nexport class PcacChartResizeService {\n /**\n * Call once from a chart component's constructor (an injection context).\n * @param chartElm Signal resolving to the chart's `<svg>` element ref, e.g. a `viewChild.required` query.\n * @param rebuild Invoked whenever the chart's container size changes: immediately for the\n * observer's first (guaranteed-initial) callback, debounced for every one after that.\n */\n observe(chartElm: Signal<ElementRef>, rebuild: () => void): void {\n const destroyRef = inject(DestroyRef);\n const trigger$ = new Subject<void>();\n trigger$.pipe(\n debounceTime(300),\n takeUntilDestroyed(destroyRef)\n ).subscribe(rebuild);\n\n // chartElm() is a required viewChild query: unreadable until this component's own view has\n // been created, so we defer the observe() call itself rather than reading it eagerly here.\n afterNextRender(() => {\n const container = chartElm().nativeElement.parentNode as HTMLElement;\n // The observer's first callback is its guaranteed initial one (see the class doc comment) -\n // it's correcting an already-wrong first paint (e.g. a host layout, like a Material sidenav,\n // that hasn't finished settling its width yet when this chart's very first build ran), not\n // responding to live resize churn, so it shouldn't sit behind the same 300ms debounce meant\n // for that. Left debounced, that correction could land while the wrong-width build's own\n // enter transition is still visibly mid-animation, restarting it partway through - firing it\n // immediately instead means the correction lands within a frame or two, before there's\n // anything to visibly interrupt. Every callback after the first is still debounced normally.\n let firstCallback = true;\n const observer = new ResizeObserver(() => {\n if (firstCallback) {\n firstCallback = false;\n rebuild();\n return;\n }\n trigger$.next();\n });\n observer.observe(container);\n destroyRef.onDestroy(() => observer.disconnect());\n });\n }\n}\n","import { Directive, TemplateRef, inject } from '@angular/core';\nimport { PcacData } from './chart.model';\n\n/**\n * Template context handed to a consumer's `<ng-template pcacTooltip>` each time a tooltip is shown.\n */\nexport interface PcacTooltipContext {\n /**\n * The hovered datum: a bar, a line/area/plot point, a pie slice, or a threshold. Bound with a\n * bare `let-point` (or any name) in the template.\n */\n $implicit: PcacData;\n\n /**\n * The `PcacData` the hovered datum sits inside - the group a bar belongs to, or the series a\n * point belongs to. For a threshold, the data group it's drawn against (a threshold's own\n * `PcacData` usually carries only a value, so this is where its label lives). `null` when there\n * is no enclosing level (pie slices, a chart-wide threshold).\n */\n parent: PcacData | null;\n\n /**\n * True when the hovered element is a threshold marker on a bar chart rather than a data point.\n * In that case `$implicit` is the threshold's own `PcacData`.\n */\n isThreshold: boolean;\n\n /**\n * Position of `$implicit` in the array it was taken from: `parent.data` when there is a parent\n * (a bar within its group, a point within its series), or the chart's top-level `data` when\n * there isn't (a pie slice). For a threshold it's the position in `config.thresholds`, or in\n * `config.thresholds[parentIndex].data` for a per-bar threshold.\n *\n * Together with `parentIndex` this lets a template reach back into whatever collection the\n * `PcacData` was built from, as long as that collection is parallel to `data` (same order, no\n * filtering): `items[parentIndex][index]` for a two-level chart, `items[index]` for a pie.\n * Charts never reorder `data`, so the correspondence is stable across builds and resizes.\n */\n index: number;\n\n /**\n * Position of `parent` in the chart's top-level `data`; `null` whenever `parent` is.\n */\n parentIndex: number | null;\n}\n\n/**\n * Marks an `<ng-template>` projected into any chart component as that chart's tooltip. When\n * present it replaces the default key/value tooltip *entirely* - the library only positions the\n * rendered template; it applies no background, padding or text styling of its own, so the template\n * owns the whole box.\n *\n * ```html\n * <pcac-bar-vertical-chart [config]=\"config\">\n * <ng-template pcacTooltip let-point let-group=\"parent\">\n * <div class=\"my-tooltip\">{{ group?.key }} / {{ point.key }}: {{ point.value | number }}</div>\n * </ng-template>\n * </pcac-bar-vertical-chart>\n * ```\n *\n * The template is rendered with full Angular semantics (pipes, directives, components, DI from\n * the declaring component), so anything a normal template can do works here too. `index` and\n * `parentIndex` locate the hovered datum within `data`, so a template can pull extra fields from\n * the consumer's own source collection when that collection is parallel to `data`:\n *\n * ```html\n * <ng-template pcacTooltip let-point let-i=\"index\" let-g=\"parentIndex\">\n * <div class=\"my-tooltip\">{{ orders[g!][i].customer }}: {{ point.value | number }}</div>\n * </ng-template>\n * ```\n */\n@Directive({\n selector: 'ng-template[pcacTooltip]'\n})\nexport class PcacTooltipDirective {\n readonly templateRef = inject<TemplateRef<PcacTooltipContext>>(TemplateRef);\n\n /**\n * Lets the template type-checker know the shape of `let-` variables declared on the\n * `<ng-template>`, so `point.value` etc. are checked against `PcacData` under strictTemplates.\n */\n static ngTemplateContextGuard(_dir: PcacTooltipDirective, _ctx: unknown): _ctx is PcacTooltipContext {\n return true;\n }\n}\n","import { Component, ElementRef, ViewEncapsulation, contentChild, effect, inject, viewChild, input } from '@angular/core';\nimport { outputFromObservable } from '@angular/core/rxjs-interop';\nimport { BarHorizontalChartBuilder } from './bar-horizontal-chart.builder';\nimport { PcacBarHorizontalChartConfig } from './bar-horizontal-chart.model';\nimport { PcacChartResizeService } from '../../core/resize.service';\nimport { PcacTooltipDirective } from '../../core/tooltip.directive';\n\n@Component({\n selector: 'pcac-bar-horizontal-chart',\n // While `config().heightFull` is on, the chart fills its container instead of using a fixed\n // height (see PcacChartConfig.heightFull). That only works if this host element itself has a\n // height to hand down, so the class stretches it to `height: 100%`; the styling lives in CSS\n // rather than being measured/set in JS so the browser resolves it as part of normal layout.\n host: { '[class.pcac-height-full]': 'config().heightFull' },\n templateUrl: './bar-horizontal-chart.component.html',\n styleUrl: './bar-horizontal-chart.component.scss',\n encapsulation: ViewEncapsulation.None,\n providers: [BarHorizontalChartBuilder]\n})\nexport class PcacBarHorizontalChartComponent {\n private chartBuilder = inject(BarHorizontalChartBuilder);\n\n readonly config = input.required<PcacBarHorizontalChartConfig>();\n readonly chartElm = viewChild.required<ElementRef>('chart');\n readonly barClicked = outputFromObservable(this.chartBuilder.barClicked$);\n\n /**\n * Optional consumer `<ng-template pcacTooltip>` projected into this element; replaces the\n * default tooltip when present (see PcacTooltipDirective).\n */\n readonly tooltipTemplate = contentChild(PcacTooltipDirective);\n\n constructor() {\n // Reacts to config() the same way ngOnChanges used to — reading it here (rather than a\n // lifecycle hook) is what makes this an effect: it tracks config() as its dependency and\n // reruns whenever a new value comes in, signal-input-changes-drive-behavior all the way down.\n effect(() => this.buildChart());\n\n // Handed over as a getter so the builder reads the query at hover time, not in the effect\n // above (see PcacChart.tooltipTemplate).\n this.chartBuilder.tooltipTemplate = () => this.tooltipTemplate()?.templateRef;\n\n inject(PcacChartResizeService).observe(this.chartElm, () => {\n // Skip the ResizeObserver's routine initial callback when it lands after the effect above\n // already built successfully at this same width — only a real size change (or a build\n // that never happened, e.g. the 0-width mount race) should trigger a rebuild here.\n if (this.chartBuilder.containerSizeChanged(this.chartElm())) {\n this.buildChart();\n }\n });\n }\n\n buildChart(): void {\n const config = this.config();\n if (config && config.data && config.data.length > 0) {\n this.chartBuilder.buildChart(this.chartElm(), config);\n }\n }\n}\n","<section class=\"pcac-bar-horizontal-chart\">\n <svg #chart></svg>\n</section>\n","import { PcacAxisChartConfig, PcacData } from '../../core/chart.model';\n\nexport class PcacBarHorizontalChartConfig extends PcacAxisChartConfig {\n isStacked: boolean = false;\n thresholds: PcacData[] = [];\n spreadColorsPerGroup: boolean = false\n colorOverride: PcacBarHorizontalChartColorOverrideConfig = new PcacBarHorizontalChartColorOverrideConfig()\n}\n\nexport class PcacBarHorizontalChartColorOverrideConfig {\n colors: string[] = []\n}\n","import { Injectable, ElementRef } from '@angular/core';\n\nimport { select, Selection, BaseType } from 'd3-selection';\nimport { scaleBand, ScaleBand, scaleLinear, ScaleLinear } from 'd3-scale';\nimport { color } from 'd3-color';\n// Imported for its side effect only: this is what adds .transition() to d3-selection's\n// Selection prototype, which this builder leans on throughout.\nimport 'd3-transition';\n\n/**\n * Lib\n */\nimport { PcacBarVerticalChartConfig } from './bar-vertical-chart.model';\nimport { PcacChart } from '../../core/chart';\nimport { PcacData } from '../../core/chart.model';\nimport { stackStarts } from '../../core/stack';\n\nimport { Subject } from 'rxjs';\n\n// `BaseType` (not the hand-rolled union this used to be, which omitted `null` and never\n// actually matched what `.selectAll()`'s default generics resolve to).\ntype GroupType = Selection<BaseType, PcacData, BaseType, PcacData>;\n\n/**\n * Provided per-component (see PcacBarVerticalChartComponent's `providers`), not root-scoped:\n * this builder extends PcacChart, which holds mutable per-chart-instance state (margin, width,\n * height, colors, svg). A root singleton would be shared and clobbered by every\n * <pcac-bar-vertical-chart> rendered at once.\n */\n@Injectable()\nexport class BarVerticalChartBuilder extends PcacChart {\n private xScaleStacked!: ScaleBand<string>;\n private xScaleGrouped!: ScaleBand<string>;\n private yScale!: ScaleLinear<number, number>;\n private barClickedSource = new Subject<PcacData>();\n barClicked$ = this.barClickedSource.asObservable();\n\n\n\n buildChart(chartElm: ElementRef, config: PcacBarVerticalChartConfig): void {\n if (!config?.data?.length) {\n return;\n }\n\n // Shallow copy: initializeAxisState() rewrites `height` for hidden axes, and that must not\n // land on the consumer's own config object (it previously did, growing it by the margins on\n // first build).\n config = { ...config };\n this.initializeAxisState(config, 'y');\n if (!this.initializeChartState(chartElm, config)) {\n return;\n }\n\n // Copy before reversing: `.reverse()` is in place, and this is the consumer's own array -\n // reversing it directly flipped their palette on every rebuild (i.e. every resize).\n if (config.colorOverride && config.colorOverride.colors) {\n this.colors = [...config.colorOverride.colors].reverse();\n }\n this.buildScales(config);\n this.drawChart(chartElm, config);\n }\n\n private buildScales(config: PcacBarVerticalChartConfig) {\n // `this.height`, not `config.height`: with `heightFull` on they differ (see\n // PcacChart.resolveHeight), and the axis, grid and bar baselines all use the resolved one.\n // Bars grow from 0, so only `domainMax` is read; `yAxis.domainMin` is ignored.\n this.yScale = scaleLinear()\n .rangeRound([0, this.height])\n .domain([this.yAxis.domainMax as number, 0]);\n\n this.xScaleStacked = scaleBand()\n .domain(config.data.map((d) => d.key as string))\n .rangeRound([0, this.width])\n .padding(0.1);\n\n this.xScaleGrouped = scaleBand()\n .padding(0.2)\n .rangeRound([0, this.xScaleStacked.bandwidth()])\n .domain(config.data[0].data.map((d) => d.key as string));\n }\n\n private drawChart(chartElm: ElementRef, config: PcacBarVerticalChartConfig): void {\n this.buildContainer(chartElm);\n this.axisBuilder.drawAxis(this.axisBuilderConfig(this.xScaleStacked, this.yScale));\n this.drawGrids(this.xScaleStacked, this.yScale);\n this.addGroups(config);\n this.axisBuilder.raiseAxes(this.svg);\n }\n\n private addGroups(config: PcacBarVerticalChartConfig) {\n const groupsContainer = this.svg.append('g')\n .attr('class', 'pcac-bars')\n .selectAll('g')\n .data(config.data)\n .enter().append('g')\n .attr('class', 'pcac-bar-group')\n .attr('data-group-id', (d: PcacData, i: number) => {\n return i;\n })\n .attr('transform', (d: PcacData) => {\n return 'translate(' + this.xScaleStacked(d.key as string) + ',0)';\n });\n\n const group = groupsContainer.selectAll('rect')\n .data((d: PcacData) => {\n return d.data;\n });\n\n this.drawBarsPerGroup(group, config);\n\n // We have no thresholds to draw\n if (!config.thresholds) {\n return;\n }\n\n // Draw threshold across entire chart\n if (config.thresholds.length === 1 && !config.thresholds[0].data) {\n this.drawThresholdAcrossChart(config);\n }\n\n // Draw threshold across each group\n if (config.thresholds.length > 1 && (!config.thresholds[0].data || config.isStacked)) {\n this.drawThresholdsPerGroup(group, config);\n }\n\n // Draw threshold across each bar in group\n if (config.thresholds.length > 1 && config.thresholds[0].data && !config.isStacked) {\n this.drawThresholdsPerBarInGroup(group, config);\n }\n }\n\n private drawBarsPerGroup(group: GroupType, config: PcacBarVerticalChartConfig) {\n const self = this;\n // Stacked bars sit on top of the ones before them in their group; every other layout draws\n // from the baseline (start 0).\n const starts = config.isStacked ? stackStarts(config.data) : new Map<PcacData, number>();\n const startOf = (d: PcacData) => starts.get(d) ?? 0;\n const endOf = (d: PcacData) => startOf(d) + Number(d.value ?? 0);\n group.enter().append('rect')\n .attr('class', 'pcac-bar')\n .attr('x', (d: PcacData) => {\n const value = !config.isStacked ? this.xScaleGrouped(d.key as string) : this.xScaleStacked(d.key as string)\n return value ? value : 0;\n })\n .attr('data-group-bar-id', (_: PcacData, i: number) => {\n return i;\n })\n .style('fill', (d: PcacData, i: number, n: any) => {\n if (config.spreadColorsPerGroup) {\n const groupIndex = parseInt(n[0].parentNode.getAttribute('data-group-id'), 10);\n return this.colors[groupIndex];\n }\n return this.colors[i];\n })\n .attr('y', () => {\n return this.height;\n })\n .attr('height', 0)\n .on('mouseover', function (this: any) {\n select(this)\n .transition()\n .duration(self.transitionService.getTransitionDuration() / 5)\n .style('fill', () => {\n if (config.spreadColorsPerGroup) {\n const groupIndex = parseInt(this.parentNode.getAttribute('data-group-id'), 10);\n const c = color(self.colors[groupIndex])\n const ct = c ? c.darker(1).toString() : self.colors[groupIndex]\n return ct\n }\n const groupIndex = parseInt(this.getAttribute('data-group-bar-id'), 10);\n const c = color(self.colors[groupIndex])\n const ct = c ? c.darker(1).toString() : self.colors[groupIndex]\n return ct\n });\n })\n .on('mousemove', function (this: SVGRectElement, event: MouseEvent, d: PcacData) {\n const groupIndex = Number((this.parentNode as Element).getAttribute('data-group-id'));\n const index = Number(this.getAttribute('data-group-bar-id'));\n self.showTooltip(event, d, { index, parent: config.data[groupIndex], parentIndex: groupIndex, valueFormat: self.yAxis.format });\n })\n .on('mouseout', function (this: any) {\n self.hideTooltip();\n select(this)\n .transition()\n .duration(self.transitionService.getTransitionDuration() / 5)\n .style('fill', () => {\n if (config.spreadColorsPerGroup) {\n const groupIndex = parseInt(this.parentNode.getAttribute('data-group-id'), 10);\n return self.colors[groupIndex];\n }\n const groupIndex = parseInt(this.getAttribute('data-group-bar-id'), 10);\n return self.colors[groupIndex];\n });\n })\n .on('click', (_, d: PcacData) => {\n this.barClickedSource.next(d);\n })\n .transition()\n .duration(this.transitionService.getTransitionDuration())\n // .transition(\n // transition().duration(this.transitionService.getTransitionDuration())\n // )\n .attr('width', !config.isStacked ? this.xScaleGrouped.bandwidth() : this.xScaleStacked.bandwidth())\n .attr('y', (d: PcacData) => {\n return this.yScale(endOf(d));\n })\n .attr('height', (d: PcacData) => {\n return this.yScale(startOf(d)) - this.yScale(endOf(d));\n });\n }\n\n private drawThresholdAcrossChart(config: PcacBarVerticalChartConfig) {\n this.applyPreTransitionThresholdStyles(this.svg.select('.pcac-bars').append('rect'))\n .attr('width', this.width)\n .attr('data-group-threshold-id', (_: unknown, i: number) => {\n return i;\n })\n .on('mousemove', (event: MouseEvent) => {\n this.showTooltip(event, config.thresholds[0], { index: 0, isThreshold: true, valueFormat: this.yAxis.format });\n })\n .transition()\n .duration(this.transitionService.getTransitionDuration())\n .attr('y', (_: unknown, i: number) => {\n return this.yScale(config.thresholds[i].value as number);\n });\n }\n\n private drawThresholdsPerGroup(group: GroupType, config: PcacBarVerticalChartConfig) {\n const self = this\n this.applyPreTransitionThresholdStyles(this.svg.selectAll('.pcac-bar-group').append('rect'))\n .attr('width', this.xScaleStacked.bandwidth())\n .attr('data-group-threshold-id', (_: unknown, i: number) => {\n return i;\n })\n .on('mousemove', function (this: any, event: MouseEvent) {\n const index = Number(this.parentElement.dataset['groupId'])\n const threshold = config.thresholds[index];\n // A threshold's own PcacData is typically just a value, so its parent is the *data* group\n // it's drawn against (which has the key) rather than the threshold entry it came from.\n self.showTooltip(\n event,\n config.isStacked ? threshold.data[0] : threshold,\n { index, parent: config.data[index], parentIndex: index, isThreshold: true, valueFormat: self.yAxis.format }\n );\n })\n .transition()\n .duration(this.transitionService.getTransitionDuration())\n .attr('y', (_: unknown, i: number) => {\n return this.yScale(config.isStacked ? config.thresholds[i].data[0].value as number : config.thresholds[i].value as number);\n });\n }\n\n private drawThresholdsPerBarInGroup(group: GroupType, config: PcacBarVerticalChartConfig) {\n const self = this\n this.applyPreTransitionThresholdStyles(group.enter().append('rect'))\n .attr('data-group-threshold-id', (_: PcacData, i: number) => {\n return i;\n })\n .on('mousemove', function (this: any, event: MouseEvent) {\n const target = event.target as Element\n const index = Number(target.getAttribute(\"data-group-threshold-id\"))\n const groupIndex = Number(this.parentElement.dataset['groupId'])\n // Parent is the data group (see drawThresholdsPerGroup), not the threshold entry itself.\n self.showTooltip(\n event,\n config.thresholds[groupIndex].data[index],\n { index, parent: config.data[groupIndex], parentIndex: groupIndex, isThreshold: true, valueFormat: self.yAxis.format }\n );\n })\n .attr('width', this.xScaleGrouped.bandwidth())\n .transition()\n .duration(this.transitionService.getTransitionDuration())\n .attr('y', (d: PcacData, i: number, n: any) => {\n return this.yScale(config.thresholds[n[0].parentElement.dataset['groupId']].data[i].value as number);\n });\n }\n\n private applyPreTransitionThresholdStyles<S extends Selection<any, any, any, any>>(elm: S): S {\n return elm.attr('class', 'pcac-threshold')\n .attr('x', (d: any) => {\n // Not every caller's selection has a per-item PcacData bound (the whole-chart threshold\n // rect has none), hence the defensive fallback rather than assuming `d` is always present.\n const datum = d as PcacData | undefined;\n // ScaleBand can return undefined for a key outside its domain; `.attr()` needs null, not undefined.\n return this.xScaleGrouped(datum ? datum.key as string : '') ?? null;\n })\n .attr('y', () => {\n return this.height;\n })\n .attr('height', 0)\n .style('fill', () => {\n return this.colorService.getAlert();\n })\n .style('stroke', () => {\n return this.colorService.getAlert();\n })\n .style('stroke-width', () => {\n return 2;\n })\n .on('mouseout', () => {\n this.hideTooltip();\n })\n .attr('height', () => {\n return '3px';\n });\n }\n}\n","import { Component, ElementRef, ViewEncapsulation, contentChild, effect, inject, viewChild, input } from '@angular/core';\nimport { outputFromObservable } from '@angular/core/rxjs-interop';\nimport { BarVerticalChartBuilder } from './bar-vertical-chart.builder';\nimport { PcacBarVerticalChartConfig } from './bar-vertical-chart.model';\nimport { PcacChartResizeService } from '../../core/resize.service';\nimport { PcacTooltipDirective } from '../../core/tooltip.directive';\n\n@Component({\n selector: 'pcac-bar-vertical-chart',\n // While `config().heightFull` is on, the chart fills its container instead of using a fixed\n // height (see PcacChartConfig.heightFull). That only works if this host element itself has a\n // height to hand down, so the class stretches it to `height: 100%`; the styling lives in CSS\n // rather than being measured/set in JS so the browser resolves it as part of normal layout.\n host: { '[class.pcac-height-full]': 'config().heightFull' },\n templateUrl: './bar-vertical-chart.component.html',\n styleUrl: './bar-vertical-chart.component.scss',\n encapsulation: ViewEncapsulation.None,\n providers: [BarVerticalChartBuilder]\n})\nexport class PcacBarVerticalChartComponent {\n private chartBuilder = inject(BarVerticalChartBuilder);\n\n readonly config = input.required<PcacBarVerticalChartConfig>();\n readonly chartElm = viewChild.required<ElementRef>('chart');\n readonly barClicked = outputFromObservable(this.chartBuilder.barClicked$);\n\n /**\n * Optional consumer `<ng-template pcacTooltip>` projected into this element; replaces the\n * default tooltip when present (see PcacTooltipDirective).\n */\n readonly tooltipTemplate = contentChild(PcacTooltipDirective);\n\n constructor() {\n // Reacts to config() the same way ngOnChanges used to — reading it here (rather than a\n // lifecycle hook) is what makes this an effect: it tracks config() as its dependency and\n // reruns whenever a new value comes in, signal-input-changes-drive-behavior all the way down.\n effect(() => this.buildChart());\n\n // Handed over as a getter so the builder reads the query at hover time, not in the effect\n // above (see PcacChart.tooltipTemplate).\n this.chartBuilder.tooltipTemplate = () => this.tooltipTemplate()?.templateRef;\n\n inject(PcacChartResizeService).observe(this.chartElm, () => {\n // Skip the ResizeObserver's routine initial callback when it lands after the effect above\n // already built successfully at this same width — only a real size change (or a build\n // that never happened, e.g. the 0-width mount race) should trigger a rebuild here.\n if (this.chartBuilder.containerSizeChanged(this.chartElm())) {\n this.buildChart();\n }\n });\n }\n\n buildChart(): void {\n const config = this.config();\n if (config && config.data && config.data.length > 0) {\n this.chartBuilder.buildChart(this.chartElm(), config);\n }\n }\n}\n","<section class=\"pcac-bar-vertical-chart\">\n <svg #chart></svg>\n</section>\n","import { PcacAxisChartConfig, PcacData } from '../../core/chart.model';\n\nexport class PcacBarVerticalChartConfig extends PcacAxisChartConfig {\n isStacked: boolean = false;\n thresholds: PcacData[] = [];\n spreadColorsPerGroup: boolean = false\n colorOverride: PcacBarVerticalChartColorOverrideConfig = new PcacBarVerticalChartColorOverrideConfig()\n}\n\nexport class PcacBarVerticalChartColorOverrideConfig {\n colors: string[] = []\n}\n","import { Component, computed, inject, model, output } from '@angular/core';\nimport { PcacColorService } from '../core';\n\nexport class PcacLegendConfigItem {\n label!: string;\n checked: boolean = true;\n colorOverride: string | null = null;\n}\n\nexport class PcacLegendConfig {\n heading: string | null = null;\n items: PcacLegendConfigItem[] = [];\n}\n\n@Component({\n selector: 'pcac-legend',\n templateUrl: './legend.component.html',\n styleUrl: './legend.component.scss',\n})\nexport class PcacLegend {\n readonly colorService = inject(PcacColorService);\n config = model.required<PcacLegendConfig>();\n itemClicked = output<PcacLegendConfigItem[]>();\n\n colorScale = computed(() => \n this.colorService.getColorScale(this.config().items.length)\n );\n\n onItemClicked(index: number) {\n const items = this.config().items.map((item, i) =>\n i === index ? { ...item, checked: !item.checked } : item\n );\n this.config.set({ ...this.config(), items });\n this.itemClicked.emit(items);\n }\n}\n","<div class=\"pcac-legend-label\"><small>{{config().heading}}</small></div>\n@for(item of config().items; track $index; let i = $index; let last = $last;) {\n<div class=\"pcac-legend-item\" [class.pcac-legend-item-last]=\"last\" [class.pcac-legend-unchecked]=\"!item.checked\"\n role=\"switch\" [attr.aria-checked]=\"item.checked\" tabindex=\"0\" (click)=\"onItemClicked(i)\"\n (keydown.enter)=\"onItemClicked(i)\" (keydown.space)=\"onItemClicked(i); $event.preventDefault()\">\n @let color = item.colorOverride ? item.colorOverride : colorScale()[i];\n <div class=\"pcac-legend-circle\" [style.backgroundColor]=\"color\"></div>\n <small>{{ item.label }}</small>\n</div>\n}\n","import { PcacAxisChartConfig } from '../core/chart.model';\n\nexport enum PcacLineAreaPlotChartConfigType {\n Line = 'line',\n Area = 'area',\n Plot = 'plot'\n}\n\n/**\n * Sizing for the images drawn in place of a point's dot (see `PcacData.image`). An image is\n * scaled uniformly (up or down) to fit inside a `maxWidth` x `maxHeight` box, preserving its\n * aspect ratio, and is centered on the data point exactly where the dot would have been.\n */\nexport class PcacPointImageConfig {\n maxWidth: number = 16\n maxHeight: number = 16\n}\n\n/**\n * The axes' `format` and `domainMin`/`domainMax` (`PcacAxisConfig`) do more here than on the bar\n * charts. `yAxis.domainMin`/`domainMax` are the y scale's domain (default 0..100). `xAxis.format`\n * decides how each point's `key` becomes an x position: `Decimal` reads it as a number on a\n * linear scale from `xAxis.domainMin` to `domainMax`, `DateTime` parses it with `new Date()` on\n * a time scale between the two (both required), and every other format - including the default -\n * places points by their index within their series, sizing the axis from the first series'\n * length and ignoring the domain fields.\n */\nexport class PcacLineAreaChartConfig extends PcacAxisChartConfig {\n enableEffects: boolean = true\n enableZoom: boolean = true\n\n /**\n * Hex color codes to override the default colors\n */\n colorOverride: string[] = []\n\n /**\n * Bounding box for any point images (`PcacData.image`) on this chart. Optional; each field falls\n * back to the `PcacPointImageConfig` default when not given, so a consumer only setting `image`\n * on their data still gets a sensibly-sized result.\n */\n pointImage?: Partial<PcacPointImageConfig>\n}\n","import { Selection, BaseType } from 'd3-selection';\nimport { ScaleLinear } from 'd3-scale';\nimport { PcacData } from '../../../core';\nimport { Injectable } from '@angular/core';\nimport { select } from 'd3-selection';\nimport { ScaleTime } from 'd3';\n\nexport interface IPlaChartEffectsBuilderConfig {\n colors: string[];\n data: PcacData[];\n width: number;\n height: number;\n svg: Selection<SVGGElement, unknown, BaseType, unknown>;\n x: ScaleLinear<number, number> | ScaleTime<number, number, never>;\n y: ScaleLinear<number, number> | ScaleTime<number, number, never>;\n}\n\n/**\n * Provided per-component (see PcacLineAreaChartComponent's `providers`), not root-scoped: this\n * holds mutable per-chart-instance state (`config`, `lines`) despite looking like a stateless\n * helper. A root singleton would be shared and clobbered by every `<pcac-line-area-chart>`\n * rendered at once — each instance's hover effects would end up reading/writing whichever\n * chart's `buildEffects()` ran last, not their own.\n */\n@Injectable()\nexport class PlaChartEffectsBuilder {\n private config!: IPlaChartEffectsBuilderConfig;\n // .getTotalLength()/.getPointAtLength() below are SVGGeometryElement methods - the paths this\n // collects are always <path> elements (see PlaChartBuilder.drawLine/.drawArea). A chart draws\n // one or the other depending on its `type` (never both), so this selector is never ambiguous.\n // Plot-type charts draw neither (just standalone dots, no connecting geometry) - updateEffects()\n // below guards against that rather than this collecting nothing for it to index into.\n private lines: SVGGeometryElement[] = [];\n\n buildEffects(config: IPlaChartEffectsBuilderConfig): void {\n this.config = config;\n this.lines = [];\n // Filtered on the same predicate buildCollection() applies to the effect groups (each path's\n // datum is its series' point array), so `lines[i]` always belongs to the i-th group - an\n // empty series in the middle of the data would otherwise shift every later group onto the\n // wrong path.\n this.config.svg.selectAll<SVGGeometryElement, PcacData[]>('.line, .area')\n .filter((d) => d?.length !== 0)\n .each((d, i, n) => {\n this.lines.push(n[i]);\n });\n this.buildCollection();\n this.buildCanvas();\n }\n\n private buildCollection() {\n const collection = this.config.svg.append('g')\n .attr('class', 'effects');\n\n collection.append('path')\n .attr('class', 'effect-line');\n\n const mousePerLine = collection.selectAll('.effect-group')\n .data(this.config.data.filter((elm) => {\n return elm.data.length > 0;\n }))\n .enter().append('g')\n .attr('class', 'effect-group')\n .attr('style', (d: PcacData) => d.hide ? 'display: none' : null);\n\n mousePerLine.append('circle')\n .attr('r', 7)\n .attr('class', 'effect-circle')\n .style('stroke', (d: PcacData, i: number) => {\n return this.config.colors[i];\n });\n\n mousePerLine.append('text')\n .attr('class', 'effect-text')\n .attr('y', 1.5)\n .attr('transform', 'translate(10,3)');\n }\n\n private buildCanvas(): void {\n this.config.svg.append('rect')\n .attr('class', 'effects-canvas')\n .attr('width', this.config.width)\n .attr('height', this.config.height)\n .attr('pointer-events', 'all')\n .on('mouseout', () => {\n this.hideEffects();\n })\n .on('mouseover', () => {\n this.showEffects();\n })\n .on('mousemove', (event: MouseEvent) => {\n const current = event.currentTarget as Element\n const parent = current.parentElement\n const xForms = parent?.getAttribute('transform')\n if(!xForms) \n return this.onMouseMove([event.offsetX, event.offsetY]);\n \n const parts = /translate\\(\\s*([^\\s,)]+)[ ,]([^\\s,)]+)/.exec(xForms);\n if(!parts) \n return this.onMouseMove([event.offsetX, event.offsetY]);\n const x = Number(parts[1])\n this.onMouseMove([event.offsetX - x, event.offsetY]);\n });\n }\n\n private showEffects() {\n this.config.svg.select('.effect-line')\n .style('opacity', '1');\n this.config.svg.selectAll('.effect-group circle')\n .style('opacity', '1');\n this.config.svg.selectAll('.effect-group text')\n .style('opacity', '1');\n }\n\n private hideEffects() {\n this.config.svg.select('.effect-line')\n .style('opacity', '0');\n this.config.svg.selectAll('.effect-group circle')\n .style('opacity', '0');\n this.config.svg.selectAll('.effect-group text')\n .style('opacity', '0');\n }\n\n private onMouseMove(mousePos: [number, number]) {\n this.updateLine(mousePos);\n this.updateEffects(mousePos);\n }\n\n private updateLine(mousePos: [number, number]) {\n this.config.svg.select('.effect-line')\n .attr('d', () => 'M' + mousePos[0] + ',' + this.config.height + ' ' + mousePos[0] + ',' + 0);\n }\n\n private updateEffects(mousePos: [number, number]) {\n this.config.svg.selectAll('.effect-group')\n .attr('transform', (data, index: number, nodes) => {\n const line = this.lines[index];\n if (!line) {\n // No connected line/area geometry for this group to walk (a plot-type chart, whose\n // dots aren't joined by a path) — nothing to position the crosshair against, so leave\n // it where it was rather than reading .getTotalLength() off undefined.\n return null;\n }\n\n let beginning = 0;\n let end = line.getTotalLength();\n let pos;\n\n while (true) {\n const target = Math.floor((beginning + end) / 2);\n pos = line.getPointAtLength(target);\n if ((target === end || target === beginning) && pos.x !== mousePos[0]) {\n break;\n }\n\n if (pos.x > mousePos[0]) {\n end = target;\n } else if (pos.x < mousePos[0]) {\n beginning = target;\n } else {\n break;\n }\n }\n\n const textTarget = this.config.y.invert(pos.y) as number\n select(nodes[index]).select('text')\n .text(textTarget.toFixed(0));\n\n return 'translate(' + mousePos[0] + ',' + pos.y + ')';\n });\n }\n}\n","\nimport { scaleTime } from 'd3';\nimport { ScaleLinear, scaleLinear, ScaleTime } from 'd3-scale';\n\n\nimport { PcacData, PcacFormatEnum, PcacResolvedAxisConfig } from '../../../core/chart.model';\n\nexport class PlaChartScales {\n x!: ScaleLinear<number, number> | ScaleTime<number, number, never>;\n y!: ScaleLinear<number, number>;\n}\n\n/**\n * Takes the chart's *resolved* axes (`PcacChart.xAxis`/`yAxis`), not the raw config, so the\n * `format`/`domainMin`/`domainMax` defaults are already applied - see `PcacLineAreaChartConfig`\n * for what each format does with them.\n */\nexport class PlaChartScalesBuilder {\n build(\n xAxis: PcacResolvedAxisConfig, yAxis: PcacResolvedAxisConfig, data: PcacData[], chartWidth: number, chartHeight: number\n ): PlaChartScales {\n const resp = new PlaChartScales();\n resp.x = this.buildXScale(xAxis, data, chartWidth);\n resp.y = this.buildYScale(yAxis, chartHeight);\n return resp;\n }\n\n private buildXScale(\n xAxis: PcacResolvedAxisConfig, data: PcacData[], chartWidth: number\n ): ScaleLinear<number, number> | ScaleTime<number, number, never> {\n switch (xAxis.format) {\n case PcacFormatEnum.DateTime:\n return scaleTime()\n .domain([new Date(xAxis.domainMin), new Date(xAxis.domainMax)])\n .range([0, chartWidth]);\n case PcacFormatEnum.Decimal:\n return scaleLinear()\n .domain([xAxis.domainMin as number, xAxis.domainMax as number])\n .range([0, chartWidth]);\n default:\n // DatasetLength and every other format position points by index\n return scaleLinear()\n .domain([0, data[0].data.length - 1])\n .range([0, chartWidth]);\n }\n }\n\n private buildYScale(yAxis: PcacResolvedAxisConfig, chartHeight: number): ScaleLinear<number, number> {\n return scaleLinear()\n .domain([yAxis.domainMin as number, yAxis.domainMax as number])\n .range([chartHeight, 0]);\n }\n}\n","import { ScaleLinear, ScaleTime } from \"d3\";\nimport { PcacData, PcacFormatEnum } from \"../../core\";\n\nexport function getXFormat(type: PcacFormatEnum, data: PcacData, index: number, xScale: ScaleLinear<number, number> | ScaleTime<number, number, never>) {\n switch (type) {\n case PcacFormatEnum.DateTime:\n if (data.key) {\n return xScale(new Date(data.key));\n }\n return 0\n case PcacFormatEnum.Decimal:\n if (data.key) {\n return xScale(data.key as unknown as number);\n }\n return 0\n default:\n return xScale(index)\n }\n}","import { line, Line } from 'd3-shape';\nimport { getXFormat } from '../x-format';\nimport { PcacData, PcacFormatEnum } from '../../../core';\nimport { PlaChartScales } from './scales.builder';\n\nexport function buildLineGenerator(format: PcacFormatEnum, scales: PlaChartScales): Line<PcacData> {\n return line<PcacData>()\n .x((d: PcacData, i) => {\n return getXFormat(format, d, i, scales.x)\n })\n .y((d: PcacData) => {\n return scales.y(d.value as number);\n });\n}","import { Area, area } from 'd3-shape';\nimport { getXFormat } from '../x-format';\nimport { PcacData, PcacFormatEnum } from '../../../core';\nimport { PlaChartScales } from './scales.builder';\n\nexport function buildAreaGenerator(format: PcacFormatEnum, scales: PlaChartScales, chartHeight: number): Area<PcacData> {\n return area<PcacData>()\n .x((d: PcacData, i) => {\n return getXFormat(format, d, i, scales.x);\n })\n .y0(chartHeight)\n .y1((d: PcacData) => {\n return scales.y(d.value as number);\n });\n}","import { zoom } from \"d3\";\n\n/**\n * `extent` (the viewport the gesture happens in) is set to the plot area explicitly rather than\n * left to d3's default, which reads the *owning `<svg>`'s* size - plot plus margins. With the\n * viewport wider than `translateExtent`, d3's constraint centers the plot within it instead of\n * pinning the two together, so the first gesture (even one that zooms straight back out to k = 1)\n * left the chart shifted right/down by half the margins: x domain min detached from the y axis,\n * domain max pushed off the right edge.\n */\nexport function buildZoomBehavior(width: number, height: number, zoomedFn: (event: d3.D3ZoomEvent<Element, unknown>) => void): d3.ZoomBehavior<Element, unknown> {\n return zoom()\n .scaleExtent([1, 10])\n .extent([[0, 0], [width, height]])\n .translateExtent([[0, 0], [width, height]])\n .on(\"zoom\", zoomedFn);\n}\n","import { ElementRef, Injectable, inject } from '@angular/core';\nimport { select } from 'd3-selection';\nimport { Line, Area } from 'd3-shape';\nimport { range } from 'd3-array';\nimport { Subject } from 'rxjs';\n\n/**\n * Lib\n */\nimport { PlaChartEffectsBuilder } from './effects.builders';\nimport { PcacLineAreaChartConfig, PcacLineAreaPlotChartConfigType, PcacPointImageConfig } from '../../plot-line-area-chart.model';\nimport { PcacChart } from '../../../core/chart';\nimport { PcacData } from '../../../core/chart.model';\nimport { PlaChartScalesBuilder, PlaChartScales } from './scales.builder';\nimport { getXFormat } from '../x-format';\nimport { buildLineGenerator } from './line-generator.builder';\nimport { buildAreaGenerator } from './area-generator.builder';\nimport { buildZoomBehavior } from './zoom-behavior.builder';\n\n/**\n * Provided per-component (see PcacLineAreaChartComponent's `providers`), not root-scoped: this\n * builder extends PcacChart, which holds mutable per-chart-instance state (margin, width,\n * height, colors, svg). A root singleton would be shared and clobbered by every\n * <pcac-line-area-chart> rendered at once.\n */\n@Injectable()\nexport class PlaChartBuilder extends PcacChart {\n private effectsBuilder = inject(PlaChartEffectsBuilder);\n private scales!: PlaChartScales;\n private lineGenerator!: Line<PcacData>;\n private areaGenerator!: Area<PcacData>;\n private zoomBehavior!: d3.ZoomBehavior<Element, unknown>;\n private dotClickedSource = new Subject<PcacData>();\n private config!: PcacLineAreaChartConfig;\n private clipPathId!: string; // <-- added\n /**\n * How far the clip-path rect extends past the drawable [0, width] x [0, height] area on every\n * side, so a point sitting exactly on the domain's edge isn't cut in half. 10px comfortably\n * clears a dot (r = 4, or 6 on hover); a point image can be much bigger than that, so\n * buildChart() widens this to half the largest image dimension whenever any point has one\n * (and grows the margins to match - see `reservePointImageSpace()` - since the clip-path only\n * matters up to the edge of the SVG).\n */\n private clipBuffer = 10;\n private pointImage!: PcacPointImageConfig;\n dotClicked$ = this.dotClickedSource.asObservable();\n\n\n buildChart(chartElm: ElementRef, config: PcacLineAreaChartConfig, type: PcacLineAreaPlotChartConfigType): void {\n if (!config?.data?.length) {\n return;\n }\n\n this.config = JSON.parse(JSON.stringify(config));\n this.startData = range(this.config.data[0].data.length).map((): PcacData => ({\n key: '',\n value: 0,\n hide: false,\n data: []\n }));\n\n // A hidden axis keeps 8px rather than 0 so a dot on the edge of the plot isn't clipped\n this.initializeAxisState(this.config, 'y', 8);\n this.reservePointImageSpace();\n\n if (!this.initializeChartState(chartElm, this.config)) {\n return;\n }\n // `?.length`, not a bare truthiness check: PcacLineAreaChartConfig defaults colorOverride to\n // `[]`, and an empty array is truthy - a config built with `new` would otherwise replace the\n // theme palette with nothing and every series would render with no color at all.\n if (this.config.colorOverride?.length) {\n this.colors = this.config.colorOverride;\n }\n\n this.scales = new PlaChartScalesBuilder().build(this.xAxis, this.yAxis, this.config.data, this.width, this.height);\n this.lineGenerator = buildLineGenerator(this.xAxis.format, this.scales);\n this.areaGenerator = buildAreaGenerator(this.xAxis.format, this.scales, this.height);\n\n if (this.config.enableZoom) {\n this.zoomBehavior = buildZoomBehavior(this.width, this.height, (event) => {\n // Rescale x\n const newX = event.transform.rescaleX(this.scales.x);\n\n // Update axis\n this.axisBuilder.drawXAxis(this.axisBuilderConfig(newX, this.scales.y));\n\n // Update lines/areas. Fresh generators against the rescaled x, so they go through the\n // same getXFormat() as the dots below - positioning by bare index here (which this used\n // to do, and which also overwrote the original generators' x accessor for good) is only\n // right for the default DatasetLength format; a DateTime/Decimal chart's lines drifted\n // away from its dots as soon as it was zoomed.\n const zoomedScales: PlaChartScales = { x: newX, y: this.scales.y };\n const zoomedLine = buildLineGenerator(this.xAxis.format, zoomedScales);\n const zoomedArea = buildAreaGenerator(this.xAxis.format, zoomedScales, this.height);\n this.svg.selectAll<SVGPathElement, PcacData[]>('.line').attr('d', (d: PcacData[]) => zoomedLine(d));\n this.svg.selectAll<SVGPathElement, PcacData[]>('.area').attr('d', (d: PcacData[]) => zoomedArea(d));\n\n // Update dots / point images. Nested selectAll (not a flat svg.selectAll('.point')) so\n // that `i` is the point's index *within its own series* - the x format default\n // (DatasetLength) positions by index, and a flat selection would number every series'\n // points consecutively, shoving the second series' points off to the right on zoom.\n this.svg.selectAll('.dots').selectAll<SVGGElement, PcacData>('.point')\n .attr('transform', (d: PcacData, i: number) => this.pointTransform(d, i, newX));\n\n // The vertical grid hangs off the x ticks too, so redraw it against the rescaled x and\n // drop it back underneath everything (append puts it on top).\n this.svg.selectAll('.pcac-grid-vertical').remove();\n this.drawGrids(newX, this.scales.y, 'x');\n this.svg.selectAll('.pcac-grid-vertical').lower();\n\n // drawXAxis re-appends the x axis at the end of the group, above the dots; put them back\n // on top so a point on the baseline isn't covered (see drawChart's draw order).\n this.svg.selectAll('.dots').raise();\n });\n }\n\n this.drawChart(chartElm, this.config, type);\n }\n\n private drawChart(chartElm: ElementRef, config: PcacLineAreaChartConfig, type: PcacLineAreaPlotChartConfigType): void {\n this.buildContainer(chartElm);\n this.attachZoomBehavior();\n this.createReusableClipPath(); \n\n this.axisBuilder.drawAxis(this.axisBuilderConfig(this.scales.x, this.scales.y));\n\n this.drawGrids(this.scales.x, this.scales.y);\n\n this.drawLineArea(config, type);\n\n if (config.enableEffects) {\n this.effectsBuilder.buildEffects({\n svg: this.svg,\n height: this.height,\n width: this.width,\n data: config.data,\n colors: this.colors,\n x: this.scales.x,\n y: this.scales.y\n });\n }\n\n // Axes above the lines/areas (so an axis line isn't covered by a series sitting at x = 0),\n // but the dots above the axes: a point on the baseline or the y axis stays whole.\n this.axisBuilder.raiseAxes(this.svg);\n this.drawDots(config);\n }\n\n /**\n * Resolves `pointImage` and, when any point actually has an `image`, makes room for one at the\n * edge of the domain: the clip-path buffer grows to half the box so the `.dots` group lets it\n * through, and the margins grow to at least that same half so the `<svg>` doesn't cut off what\n * the clip-path let through (an image box is centered on its point, so at the top of the y\n * domain half of it sits above the plot area - in `margin.top`, which is only 8px by default).\n * Must run between `initializeAxisState()` and `initializeChartState()`, see `reserveEdgeSpace`.\n */\n private reservePointImageSpace(): void {\n this.pointImage = { ...new PcacPointImageConfig(), ...this.config.pointImage };\n const hasImages = this.config.data.some((series) => series.data.some((point) => !!point.image));\n if (!hasImages) {\n this.clipBuffer = 10;\n return;\n }\n const halfWidth = Math.ceil(this.pointImage.maxWidth / 2);\n const halfHeight = Math.ceil(this.pointImage.maxHeight / 2);\n this.clipBuffer = Math.max(10, halfWidth, halfHeight);\n this.reserveEdgeSpace({ top: halfHeight, bottom: halfHeight, left: halfWidth, right: halfWidth });\n }\n\n private createReusableClipPath(): void {\n this.clipPathId = `pcac-clip-${Date.now()}-${Math.floor(Math.random() * 10000)}`;\n this.svg.selectAll(`defs #${this.clipPathId}`).remove();\n this.svg.append('defs')\n .append('clipPath')\n .attr('id', this.clipPathId)\n .append('rect')\n // Extend the clip-path past the drawable area on every side so a dot (or point image) at\n // the x-domain's min/max, or the top/bottom of the y range, isn't cut in half. See clipBuffer.\n .attr('x', -this.clipBuffer)\n .attr('y', -this.clipBuffer)\n .attr('width', this.width + this.clipBuffer * 2)\n .attr('height', this.height + this.clipBuffer * 2);\n }\n\n private attachZoomBehavior(): void {\n if (!this.config.enableZoom) return;\n\n // Add a transparent rect to capture zoom events\n //\n // d3's `ZoomBehavior<Element, unknown>` vs. our concretely-typed `Selection<SVGRectElement|SVGGElement, ...>`\n // is a known D3+TS typings friction point: `.call()` structurally compares nested generic Selection\n // methods (`.merge()`, `.select()`, ...) and those never line up across two different concrete element\n // types, even though a zoom behavior works on any element at runtime. Narrow, local `any` escape hatch.\n this.svg.insert('rect', ':first-child')\n .attr('width', this.width)\n .attr('height', this.height)\n .attr('fill', 'none')\n .attr('pointer-events', 'all')\n .call(this.zoomBehavior as any)\n .transition()\n .duration(750)\n\n this.svg.call(this.zoomBehavior as any)\n .transition()\n .duration(750)\n }\n\n private drawLineArea(config: PcacLineAreaChartConfig, type: PcacLineAreaPlotChartConfigType): void {\n for (let i = 0; i < config.data.length; i++) {\n if (type === PcacLineAreaPlotChartConfigType.Area) {\n this.drawArea(config.data[i].data, i, config.data[i].hide);\n } else if (type === PcacLineAreaPlotChartConfigType.Line) {\n this.drawLine(config.data[i].data, i, config.data[i].hide);\n }\n }\n }\n\n private drawLine(lineData: PcacData[], index: number, hide = false): void {\n this.svg.append('g')\n .attr('class', 'lines')\n .attr('clip-path', `url(#${this.clipPathId})`) // <-- apply clip-path to line group\n .append('path')\n .datum(lineData)\n .attr('class', 'line')\n .attr('d', this.lineGenerator(this.startData))\n .transition()\n .duration(this.transitionService.getTransitionDuration())\n .attr('d', this.lineGenerator)\n .attr('stroke', () => {\n return this.colors[index];\n })\n .attr('fill', 'none')\n .attr('style', () => hide ? 'display: none' : null);\n }\n\n private drawArea(lineData: PcacData[], index: number, hide = false) {\n this.svg.append('g')\n .attr('class', 'areas')\n .attr('clip-path', `url(#${this.clipPathId})`) // <-- apply clip\n .append('path')\n .datum(lineData)\n .attr('class', 'area')\n // Same `hide` handling as drawLine()/drawDots(); the area used to ignore it and paint\n // a hidden series' fill anyway.\n .style('display', () => hide ? 'none' : null)\n .style('opacity', 0.5)\n .style('fill', () => {\n return this.colors[index];\n })\n .attr('d', this.areaGenerator(this.startData))\n .transition()\n .duration(this.transitionService.getTransitionDuration())\n .attr('d', this.areaGenerator);\n }\n\n /**\n * Draws one `<g class=\"dots\">` per series holding a `<g class=\"point\">` per data point. The\n * point group carries the x position (as a translate) so that zoom only has to touch that one\n * attribute regardless of what's inside; the child is either the regular `<circle class=\"dot\">`\n * or, when the point has a `PcacData.image`, an `<image class=\"dot-image\">` in its place. Both\n * animate in from the baseline the same way, and the tooltip / click handlers sit on the group\n * so they behave identically for either.\n */\n private drawDots(config: PcacLineAreaChartConfig): void {\n const self = this;\n const duration = this.transitionService.getTransitionDuration();\n const { maxWidth, maxHeight } = this.pointImage;\n\n for (let index = 0; index < config.data.length; index++) {\n const series = config.data[index];\n const points = this.svg.append('g')\n .attr('class', 'dots')\n .attr('clip-path', `url(#${this.clipPathId})`) // <-- apply clip\n .attr('style', series.hide ? 'display: none' : null)\n .selectAll('.point')\n .data(series.data)\n .enter().append('g')\n .attr('class', 'point')\n .attr('transform', (d: PcacData, i: number) => this.pointTransform(d, i, this.scales.x))\n .on('mouseover', function (this: SVGGElement, event: MouseEvent, d: PcacData) {\n // `d` is the very element bound from `series.data` above, so identity lookup is exact.\n self.showTooltip(event, d, {\n index: series.data.indexOf(d),\n parent: series,\n parentIndex: index,\n valueFormat: self.yAxis.format,\n keyFormat: self.xAxis.format,\n });\n // No-op for an image point (no circle inside to grow).\n select(this).select('.dot')\n .transition()\n .duration(duration / 3)\n .attr('r', 6)\n .attr('fill', self.colors[index]);\n })\n .on('mouseout', function (this: SVGGElement) {\n self.hideTooltip();\n select(this).select('.dot')\n .transition()\n .duration(duration / 3)\n .attr('r', 4)\n .attr('fill', '#fff');\n })\n .on('click', (_event: MouseEvent, d: PcacData) => {\n this.dotClickedSource.next(d);\n });\n\n points.filter((d: PcacData) => !d.image)\n .append('circle')\n .attr('class', 'dot')\n .attr('stroke', this.colors[index])\n .attr('cy', this.scales.y(0))\n .attr('fill', '#fff')\n .transition()\n .duration(duration)\n .attr('cy', (d: PcacData) => this.scales.y(d.value as number))\n .attr('r', 4);\n\n // `preserveAspectRatio=\"xMidYMid meet\"` is what does the \"resize to fit\" - the image is\n // scaled uniformly to fit inside the maxWidth x maxHeight box and centered within it, so\n // a non-square image still lands centered on the point. x/y offset by half the box so the\n // box (not its top-left corner) is centered on the data point, matching where a dot sits.\n points.filter((d: PcacData) => !!d.image)\n .append('image')\n .attr('class', 'dot-image')\n .attr('href', (d: PcacData) => d.image as string)\n .attr('width', maxWidth)\n .attr('height', maxHeight)\n .attr('preserveAspectRatio', 'xMidYMid meet')\n .attr('x', -maxWidth / 2)\n .attr('y', this.scales.y(0) - maxHeight / 2)\n .transition()\n .duration(duration)\n .attr('y', (d: PcacData) => this.scales.y(d.value as number) - maxHeight / 2);\n }\n }\n\n private pointTransform(d: PcacData, i: number, xScale: PlaChartScales['x']): string {\n return `translate(${getXFormat(this.xAxis.format, d, i, xScale)}, 0)`;\n }\n}\n","import { Component, ElementRef, TemplateRef, ViewEncapsulation, effect, inject, viewChild, input } from '@angular/core';\nimport { outputFromObservable } from '@angular/core/rxjs-interop';\n\nimport { PcacLineAreaChartConfig, PcacLineAreaPlotChartConfigType } from './plot-line-area-chart.model';\nimport { PlaChartBuilder } from './core/builders/chart.builder';\nimport { PlaChartEffectsBuilder } from './core/builders/effects.builders';\nimport { PcacChartResizeService } from '../core/resize.service';\nimport { PcacTooltipContext } from '../core/tooltip.directive';\n\n@Component({\n selector: 'pcac-line-area-chart',\n // While `config().heightFull` is on, the chart fills its container instead of using a fixed\n // height (see PcacChartConfig.heightFull). That only works if this host element itself has a\n // height to hand down, so the class stretches it to `height: 100%`; the styling lives in CSS\n // rather than being measured/set in JS so the browser resolves it as part of normal layout.\n host: { '[class.pcac-height-full]': 'config().heightFull' },\n templateUrl: './plot-line-area-chart.component.html',\n styleUrl: './plot-line-area-chart.component.scss',\n encapsulation: ViewEncapsulation.None,\n // PlaChartEffectsBuilder must be listed here too, not just PlaChartBuilder: it's injected\n // *inside* PlaChartBuilder, but its own per-instance state (see its class doc) still needs\n // this component's injector to shadow its (default) root scope, or every <pcac-line-area-chart>\n // on the page would share one PlaChartEffectsBuilder instance.\n providers: [PlaChartBuilder, PlaChartEffectsBuilder]\n})\nexport class PcacLineAreaChartComponent {\n private chartBuilder = inject(PlaChartBuilder);\n\n readonly config = input.required<PcacLineAreaChartConfig>();\n readonly type = input.required<PcacLineAreaPlotChartConfigType>();\n\n readonly chartElm = viewChild.required<ElementRef>('chart');\n readonly dotClicked = outputFromObservable(this.chartBuilder.dotClicked$);\n\n /**\n * The consumer's `<ng-template pcacTooltip>`, forwarded by the PcacLineChart/PcacAreaChart/\n * PcacPlotChart wrapper it was projected into. An input rather than a `contentChild()` query\n * of this component's own: content queries only see nodes declared directly inside the\n * element in the consumer's template, not ones the wrapper re-projects through `<ng-content>`,\n * so the wrapper has to run the query and pass the result down.\n */\n readonly tooltipTemplate = input<TemplateRef<PcacTooltipContext>>();\n\n constructor() {\n // Reacts to config()/type() the same way ngOnChanges used to — reading them here (rather\n // than a lifecycle hook) is what makes this an effect: it tracks whichever signals\n // buildChart() reads and reruns whenever either changes. That includes type(), which the old\n // ngOnChanges deliberately ignored (it only compared changes['config']) — in practice type()\n // is always bound to a constant per wrapper (PcacLineChart/PcacAreaChart/PcacPlotChart), so\n // this is unreachable today, but reacting to it is the more correct behavior regardless.\n effect(() => this.buildChart());\n\n // Handed over as a getter so the builder reads the input at hover time, not in the effect\n // above (see PcacChart.tooltipTemplate).\n this.chartBuilder.tooltipTemplate = () => this.tooltipTemplate();\n\n inject(PcacChartResizeService).observe(this.chartElm, () => {\n // Skip the ResizeObserver's routine initial callback when it lands after the effect above\n // already built successfully at this same width — only a real size change (or a build\n // that never happened, e.g. the 0-width mount race) should trigger a rebuild here.\n if (this.chartBuilder.containerSizeChanged(this.chartElm())) {\n this.buildChart();\n }\n });\n }\n\n buildChart(): void {\n const config = this.config();\n if (config && config.data && config.data.length > 0) {\n this.chartBuilder.buildChart(this.chartElm(), config, this.type());\n }\n }\n}\n","<section class=\"pcac-line-area-chart\">\n <svg #chart></svg>\n</section>\n\n","import { Component, contentChild, input, output } from \"@angular/core\";\nimport { PcacLineAreaChartComponent } from \"../plot-line-area-chart.component\";\nimport { PcacPlotChartConfig } from \"./plot.model\";\nimport { PcacLineAreaPlotChartConfigType } from \"../plot-line-area-chart.model\";\nimport { PcacData } from \"../../core\";\nimport { PcacTooltipDirective } from \"../../core/tooltip.directive\";\n\n@Component({\n selector: 'pcac-plot-chart',\n // Passes `heightFull` down the wrapper: the inner <pcac-line-area-chart> can only fill a host\n // that has a height itself (see PcacChartConfig.heightFull).\n host: { '[class.pcac-height-full]': 'config().heightFull' },\n templateUrl: './plot.component.html',\n imports: [PcacLineAreaChartComponent]\n})\nexport class PcacPlotChart {\n readonly config = input.required<PcacPlotChartConfig>();\n readonly types = PcacLineAreaPlotChartConfigType;\n readonly dotClicked = output<PcacData>();\n\n /**\n * Optional consumer `<ng-template pcacTooltip>` projected into this element, forwarded to the\n * inner chart (see PcacLineAreaChartComponent.tooltipTemplate for why it can't query it itself).\n */\n readonly tooltipTemplate = contentChild(PcacTooltipDirective);\n}\n","<pcac-line-area-chart [config]=\"config()\" [tooltipTemplate]=\"tooltipTemplate()?.templateRef\" [type]=\"types.Plot\" (dotClicked)=\"dotClicked.emit($event)\"/>","import { PcacLineAreaChartConfig } from \"../plot-line-area-chart.model\";\n\nexport class PcacPlotChartConfig extends PcacLineAreaChartConfig {\n\n}","import { Component, contentChild, input, output } from \"@angular/core\";\nimport { PcacLineAreaChartComponent } from \"../plot-line-area-chart.component\";\nimport { PcacLineChartConfig } from \"./line.model\";\nimport { PcacLineAreaPlotChartConfigType } from \"../plot-line-area-chart.model\";\nimport { PcacData } from \"../../core\";\nimport { PcacTooltipDirective } from \"../../core/tooltip.directive\";\n\n@Component({\n selector: 'pcac-line-chart',\n // Passes `heightFull` down the wrapper: the inner <pcac-line-area-chart> can only fill a host\n // that has a height itself (see PcacChartConfig.heightFull).\n host: { '[class.pcac-height-full]': 'config().heightFull' },\n templateUrl: \"./line.component.html\",\n imports: [PcacLineAreaChartComponent]\n})\nexport class PcacLineChart {\n readonly config = input.required<PcacLineChartConfig>();\n readonly types = PcacLineAreaPlotChartConfigType;\n readonly dotClicked = output<PcacData>()\n\n /**\n * Optional consumer `<ng-template pcacTooltip>` projected into this element, forwarded to the\n * inner chart (see PcacLineAreaChartComponent.tooltipTemplate for why it can't query it itself).\n */\n readonly tooltipTemplate = contentChild(PcacTooltipDirective);\n}\n","<pcac-line-area-chart [config]=\"config()\" [tooltipTemplate]=\"tooltipTemplate()?.templateRef\" [type]=\"types.Line\" (dotClicked)=\"dotClicked.emit($event)\" />","import { PcacLineAreaChartConfig } from \"../plot-line-area-chart.model\";\n\nexport class PcacLineChartConfig extends PcacLineAreaChartConfig {\n\n}","import { Component, contentChild, input, output } from \"@angular/core\";\nimport { PcacAreaChartConfig } from \"./area.model\";\nimport { PcacLineAreaChartComponent } from \"../plot-line-area-chart.component\";\nimport { PcacLineAreaPlotChartConfigType } from \"../plot-line-area-chart.model\";\nimport { PcacData } from \"../../core\";\nimport { PcacTooltipDirective } from \"../../core/tooltip.directive\";\n\n@Component({\n selector: 'pcac-area-chart',\n // Passes `heightFull` down the wrapper: the inner <pcac-line-area-chart> can only fill a host\n // that has a height itself (see PcacChartConfig.heightFull).\n host: { '[class.pcac-height-full]': 'config().heightFull' },\n templateUrl: './area.component.html',\n imports: [PcacLineAreaChartComponent]\n})\nexport class PcacAreaChart {\n readonly config = input.required<PcacAreaChartConfig>();\n readonly types = PcacLineAreaPlotChartConfigType;\n readonly dotClicked = output<PcacData>()\n\n /**\n * Optional consumer `<ng-template pcacTooltip>` projected into this element, forwarded to the\n * inner chart (see PcacLineAreaChartComponent.tooltipTemplate for why it can't query it itself).\n */\n readonly tooltipTemplate = contentChild(PcacTooltipDirective);\n}\n","<pcac-line-area-chart [config]=\"config()\" [tooltipTemplate]=\"tooltipTemplate()?.templateRef\" [type]=\"types.Area\" (dotClicked)=\"dotClicked.emit($event)\" />","import { PcacLineAreaChartConfig } from \"../plot-line-area-chart.model\";\n\nexport class PcacAreaChartConfig extends PcacLineAreaChartConfig {\n\n}","// export * from './plot-line-area-chart.builder';\n// export * from './plot-line-area-chart.component';\n// export * from './plot-line-area-chart.model';\n// The rest of that model stays internal (the shared PcacLineAreaChartConfig is reached through\n// the per-chart PcacLineChartConfig/PcacAreaChartConfig/PcacPlotChartConfig subclasses), but\n// the point-image sizing type is part of those configs' public shape, so it's exported alone.\nexport { PcacPointImageConfig } from './plot-line-area-chart.model';\nexport * from './plot/plot.component';\nexport * from './plot/plot.model';\nexport * from './line/line.component';\nexport * from './line/line.model';\nexport * from './area/area.component';\nexport * from './area/area.model';","import { Injectable, ElementRef } from '@angular/core';\n\n/**\n * D3\n */\nimport { arc, pie, Arc, Pie, PieArcDatum } from 'd3-shape';\nimport { select } from 'd3-selection';\nimport { interpolate } from 'd3-interpolate';\nimport { transition } from 'd3-transition';\nimport { color } from 'd3-color';\n\n/**\n * Lib\n */\nimport { PcacPieChartConfig } from './pie-chart.model';\nimport { PcacChart } from '../core/chart';\nimport { PcacData } from '../core/chart.model';\n\nimport { Subject } from 'rxjs';\n\n\n/**\n * Provided per-component (see PcacPieChartComponent's `providers`), not root-scoped:\n * this builder extends PcacChart, which holds mutable per-chart-instance state (margin, width,\n * height, colors, svg). A root singleton would be shared and clobbered by every\n * <pcac-pie-chart> rendered at once.\n */\n@Injectable()\nexport class PieChartBuilder extends PcacChart {\n private radius!: number;\n private arcShape!: Arc<any, PieArcDatum<PcacData>>;\n private arcOverShape!: Arc<any, PieArcDatum<PcacData>>;\n private pieAngles!: Pie<any, PcacData>;\n private sliceClickedSource = new Subject<PcacData>();\n sliceClicked$ = this.sliceClickedSource.asObservable();\n\n buildChart(chartElm: ElementRef, config: PcacPieChartConfig): void {\n if (!config?.data?.length) {\n return;\n }\n\n // The pie deliberately opts out of `heightFull`: `height` here feeds the radius rather than a\n // drawing area, so growing into a tall container would silently change the size of the pie\n // itself. `PcacPieChartConfig` inherits the property from PcacChartConfig, so it's neutralized\n // here rather than being absent from the type. (`<pcac-pie-chart>` also never gets the\n // `pcac-height-full` class the other charts use to stretch their host.)\n if (!this.initializeChartState(chartElm, { ...config, heightFull: false })) {\n return;\n }\n this.radius = Math.min(Math.min(this.height, this.width), Math.min(this.height, this.width)) / 2;\n this.buildShapes();\n this.drawChart(chartElm, config);\n }\n\n private buildShapes(): void {\n const radiusOffset = 10;\n\n this.arcShape = arc<any, PieArcDatum<PcacData>>()\n .innerRadius(0)\n .outerRadius(this.radius - radiusOffset);\n\n this.arcOverShape = arc<any, PieArcDatum<PcacData>>()\n .innerRadius(0)\n .outerRadius(this.radius - radiusOffset + radiusOffset);\n\n this.pieAngles = pie<PcacData>()\n .sort(null)\n .value((d: PcacData) => d.value as number);\n }\n\n private drawChart(chartElm: ElementRef, config: PcacPieChartConfig): void {\n this.buildContainer(chartElm, true);\n const self = this;\n this.svg.selectAll('.pcac-arc')\n .data(this.pieAngles(config.data))\n .enter().append('g')\n .attr('class', 'pcac-arc')\n .append('path')\n .style('fill', (d: PieArcDatum<PcacData>, i: number) => {\n return this.colors[i];\n })\n .on('mouseover', function (this: SVGPathElement, _: MouseEvent, d: PieArcDatum<PcacData>) {\n const t = transition().duration(self.transitionService.getTransitionDuration() / 3)\n const c = color(self.colors[d.index])\n const ct = c ? c.darker(1).toString() : self.colors[d.index]\n select<SVGPathElement, PieArcDatum<PcacData>>(this).transition(t)\n .attr('d', self.arcOverShape)\n .style('fill', ct);\n })\n .on('mousemove', (event: MouseEvent, d: PieArcDatum<PcacData>) => {\n self.showTooltip(event, d.data, { index: d.index });\n })\n .on('mouseout', function (this: SVGPathElement, _: MouseEvent, d: PieArcDatum<PcacData>) {\n self.hideTooltip();\n select<SVGPathElement, PieArcDatum<PcacData>>(this)\n .transition()\n .duration(self.transitionService.getTransitionDuration() / 3)\n .attr('d', self.arcShape)\n .style('fill', self.colors[d.index]);\n })\n .on('click', (_event: MouseEvent, d: PieArcDatum<PcacData>) => {\n this.sliceClickedSource.next(d.data);\n })\n .transition()\n .duration(this.transitionService.getTransitionDuration())\n .attrTween('d', (b: PieArcDatum<PcacData>) => {\n return this.tweenChart(b);\n });\n }\n\n private tweenChart(b: PieArcDatum<PcacData>) {\n // `innerRadius`/`outerRadius` aren't part of PieArcDatum - arcShape's own .innerRadius()/.outerRadius()\n // accessors are fixed constants and never read them from the datum, so this is a legacy no-op kept for parity.\n (b as unknown as { innerRadius: number }).innerRadius = 0;\n const i = interpolate({ startAngle: 0, endAngle: 0 }, b);\n return (t: number) => this.arcShape(i(t)) ?? '';\n }\n}\n","import { Component, ElementRef, ViewEncapsulation, contentChild, effect, inject, viewChild, input } from '@angular/core';\nimport { outputFromObservable } from '@angular/core/rxjs-interop';\nimport { PcacPieChartConfig } from './pie-chart.model';\nimport { PieChartBuilder } from './pie-chart.builder';\nimport { PcacChartResizeService } from '../core/resize.service';\nimport { PcacTooltipDirective } from '../core/tooltip.directive';\n\n@Component({\n selector: 'pcac-pie-chart',\n templateUrl: './pie-chart.component.html',\n styleUrl: './pie-chart.component.scss',\n encapsulation: ViewEncapsulation.None,\n providers: [PieChartBuilder]\n})\nexport class PcacPieChartComponent {\n private chartBuilder = inject(PieChartBuilder);\n\n readonly config = input.required<PcacPieChartConfig>();\n readonly chartElm = viewChild.required<ElementRef>('chart');\n readonly sliceClicked = outputFromObservable(this.chartBuilder.sliceClicked$);\n\n /**\n * Optional consumer `<ng-template pcacTooltip>` projected into this element; replaces the\n * default tooltip when present (see PcacTooltipDirective).\n */\n readonly tooltipTemplate = contentChild(PcacTooltipDirective);\n\n constructor() {\n // Reacts to config() the same way ngOnChanges used to — reading it here (rather than a\n // lifecycle hook) is what makes this an effect: it tracks config() as its dependency and\n // reruns whenever a new value comes in, signal-input-changes-drive-behavior all the way down.\n effect(() => this.buildChart());\n\n // Handed over as a getter so the builder reads the query at hover time, not in the effect\n // above (see PcacChart.tooltipTemplate).\n this.chartBuilder.tooltipTemplate = () => this.tooltipTemplate()?.templateRef;\n\n inject(PcacChartResizeService).observe(this.chartElm, () => {\n // Skip the ResizeObserver's routine initial callback when it lands after the effect above\n // already built successfully at this same width — only a real size change (or a build\n // that never happened, e.g. the 0-width mount race) should trigger a rebuild here.\n if (this.chartBuilder.containerSizeChanged(this.chartElm())) {\n this.buildChart();\n }\n });\n }\n\n buildChart(): void {\n const config = this.config();\n if (config && config.data && config.data.length > 0) {\n this.chartBuilder.buildChart(this.chartElm(), config);\n }\n }\n}\n","<section class=\"pcac-pie-chart\">\n <svg #chart></svg>\n</section>\n\n","import { PcacChartConfig } from '../core/chart.model';\n\nexport class PcacPieChartConfig extends PcacChartConfig {\n}\n","/*\n * Public API Surface of pioneer-charts\n */\n\nexport * from './lib/bar-chart/bar-horizontal-chart/public-api';\nexport * from './lib/bar-chart/bar-vertical-chart/public-api';\nexport * from './lib/core/public-api';\nexport * from './lib/legend/public-api';\nexport * from './lib/plot-line-area-chart/public-api';\nexport * from './lib/pie-chart/public-api';\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["select"],"mappings":";;;;;;;;;;;;;;;;AAAA;;;AAGG;MACU,eAAe,CAAA;AAC1B;;AAEG;IACH,IAAI,GAAe,EAAE;IACrB,MAAM,GAAW,GAAG;AAEpB;;;;;;;;;;;;;AAaG;IACH,UAAU,GAAa,KAAK;AAC7B;AAED;;;AAGG;MACU,iBAAiB,CAAA;AAC5B,IAAA,GAAG;AACH,IAAA,GAAG;AACH,IAAA,GAAG;AACJ;AAED;;;;;;;AAOG;MACU,cAAc,CAAA;AACzB;;;;AAIG;IACH,IAAI,GAAa,KAAK;AAEtB;;;;;;;AAOG;AACH,IAAA,QAAQ;AAER;;;;AAIG;IACH,KAAK,GAAY,CAAC;AAElB;;;;;;;;;AASG;AACH,IAAA,QAAQ;AAER;;;;AAIG;IACH,QAAQ,GAAa,KAAK;AAE1B;;;;;;AAMG;AACH,IAAA,KAAK;AAEL;;;;;;;AAOG;AACH,IAAA,SAAS;AAET;;;;;;;AAOG;AACH,IAAA,MAAM,GAAoB,cAAc,CAAC,IAAI;AAE7C;;;;;;;AAOG;IACH,SAAS,GAAqB,CAAC;IAC/B,SAAS,GAAqB,GAAG;AAClC;AAoBD;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,CAAC,eAAe,CAAC,EAAA,QAAA,EAAA,0EAAA,EAAA,MAAA,EAAA,CAAA,iGAAA,CAAA,EAAA;AAMuB,SAAA,CAAA,EAAA,cAAA,EAAA,MAAA,EAAA,EAAA,cAAA,EAAA,EAAA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,QAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAAA,OAAO,6JAOlB,oBAAoB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEvBxD,MAAO,kBAAmB,SAAQ,eAAe,CAAA;AACtD;;ACHD;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"pioneer-code-pioneer-charts.mjs","sources":["../../../projects/pioneer-charts/src/lib/core/chart.model.ts","../../../projects/pioneer-charts/src/lib/core/axis.builder.ts","../../../projects/pioneer-charts/src/lib/core/grid.builder.ts","../../../projects/pioneer-charts/src/lib/core/color.service.ts","../../../projects/pioneer-charts/src/lib/core/transition.service.ts","../../../projects/pioneer-charts/src/lib/core/tooltip.builder.ts","../../../projects/pioneer-charts/src/lib/core/chart.ts","../../../projects/pioneer-charts/src/lib/core/stack.ts","../../../projects/pioneer-charts/src/lib/bar-chart/bar-horizontal-chart/bar-horizontal-chart.builder.ts","../../../projects/pioneer-charts/src/lib/core/resize.service.ts","../../../projects/pioneer-charts/src/lib/core/tooltip.directive.ts","../../../projects/pioneer-charts/src/lib/bar-chart/bar-horizontal-chart/bar-horizontal-chart.component.ts","../../../projects/pioneer-charts/src/lib/bar-chart/bar-horizontal-chart/bar-horizontal-chart.component.html","../../../projects/pioneer-charts/src/lib/bar-chart/bar-horizontal-chart/bar-horizontal-chart.model.ts","../../../projects/pioneer-charts/src/lib/bar-chart/bar-vertical-chart/bar-vertical-chart.builder.ts","../../../projects/pioneer-charts/src/lib/bar-chart/bar-vertical-chart/bar-vertical-chart.component.ts","../../../projects/pioneer-charts/src/lib/bar-chart/bar-vertical-chart/bar-vertical-chart.component.html","../../../projects/pioneer-charts/src/lib/bar-chart/bar-vertical-chart/bar-vertical-chart.model.ts","../../../projects/pioneer-charts/src/lib/legend/legend.component.ts","../../../projects/pioneer-charts/src/lib/legend/legend.component.html","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/plot-line-area-chart.model.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/core/builders/effects.builders.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/plot/plot.model.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/core/builders/scales.builder.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/core/x-format.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/core/builders/line-generator.builder.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/core/builders/area-generator.builder.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/core/builders/zoom-behavior.builder.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/core/builders/fan-out.builder.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/core/builders/chart.builder.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/plot-line-area-chart.component.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/plot-line-area-chart.component.html","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/plot/plot.component.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/plot/plot.component.html","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/line/line.component.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/line/line.component.html","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/line/line.model.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/area/area.component.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/area/area.component.html","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/area/area.model.ts","../../../projects/pioneer-charts/src/lib/plot-line-area-chart/public-api.ts","../../../projects/pioneer-charts/src/lib/pie-chart/pie-chart.builder.ts","../../../projects/pioneer-charts/src/lib/pie-chart/pie-chart.component.ts","../../../projects/pioneer-charts/src/lib/pie-chart/pie-chart.component.html","../../../projects/pioneer-charts/src/lib/pie-chart/pie-chart.model.ts","../../../projects/pioneer-charts/src/public-api.ts","../../../projects/pioneer-charts/src/pioneer-code-pioneer-charts.ts"],"sourcesContent":["/**\n * Base configuration for all charts.\n * INewChart extends IChart\n */\nexport class PcacChartConfig {\n /**\n * Height in pixels\n */\n data: PcacData[] = []\n height: number = 200\n\n /**\n * When true, `height` becomes a *minimum* height: if the container the chart is placed in is\n * taller than `height`, the chart grows to fill it instead.\n *\n * The chart fills its own host element (`<pcac-bar-vertical-chart>` etc.), which it stretches\n * to `height: 100%` while this is on - so the consumer just needs to give the element wrapping\n * the chart a definite height (an explicit height, or a flex/grid track that resolves to one).\n * If that wrapper turns out to be auto-height, there's nothing definite to fill and the chart\n * falls back to `height`.\n *\n * Optional (rather than defaulted like the properties above) so that adding it doesn't force\n * every existing consumer that builds a config as an object literal to declare it; the `= false`\n * initializer still applies to anything constructed via `new`.\n */\n heightFull?: boolean = false\n}\n\n/**\n * Up to three short labels placed along an axis by position rather than by value: `min` at its\n * start, `mid` at its center, `max` at its end. Any subset can be given.\n */\nexport class PcacAxisSubLabels {\n min?: string\n mid?: string\n max?: string\n}\n\n/**\n * Everything configurable about one axis. Used twice per chart, as `xAxis` and `yAxis` on\n * `PcacAxisChartConfig`, so the two never drift apart and a new per-axis option lands in one place.\n *\n * Every field is optional so an object-literal / JSON config can give just the ones it cares\n * about (or omit the axis entirely); the initializers apply to anything built with `new`, and\n * `resolveAxisConfig()` fills the rest in for builders.\n */\nexport class PcacAxisConfig {\n /**\n * Don't draw this axis at all (labels, tick marks, line), and give the margins it would have\n * occupied back to the plot area. Hiding the y axis reclaims the left and top margins; hiding\n * the x axis reclaims the bottom and right. The chart's total footprint doesn't change.\n */\n hide?: boolean = false\n\n /**\n * Draw grid lines from this axis's ticks (or, on a category axis, from each category) across\n * the plot: horizontal lines for the y axis, vertical for the x. Left unset, each chart keeps\n * the grid it has always drawn - the y axis's on vertical bar and line/area/plot charts, the\n * x axis's on the horizontal bar chart - and no other; set it to turn either grid on or off\n * explicitly. Deliberately has no initializer, since \"unset\" is what carries the per-chart\n * default.\n */\n showGrid?: boolean\n\n /**\n * Requested number of ticks (D3's `ticks()` hint, so the actual count can differ slightly) -\n * also the number of grid lines for this axis. Ignored by a category (band) axis, which has one\n * tick per category. Default 5.\n */\n ticks?: number = 5\n\n /**\n * Length in pixels of the small tick marks. Tick marks are not drawn at all unless this is set\n * (the theme hides them, as it always has), so setting a size is also what turns them on; D3's\n * default 6px is a sensible first value. `0` keeps them off but still pulls the labels in to\n * the axis. Labels follow the marks (D3 places them at tick length + 3px), and the chart's\n * margins grow or shrink by the same amount so the plot area makes room for them - a longer\n * tick means a slightly smaller plot, never labels pushed off the edge. Only the per-tick marks\n * change; the axis line's two end-caps keep their default length. Color comes from the theme\n * (`.pcac-axis-tick-marks .tick line`, `$gray-900`, the same as the axis line).\n */\n tickSize?: number\n\n /**\n * Draw a solid line along the axis itself (the full length of the axis, with D3's short\n * end-caps). Off by default, as the theme has always hidden it. Color comes from the theme\n * (`.pcac-axis-line .domain`, `$gray-900`).\n */\n showLine?: boolean = false\n\n /**\n * A title for the whole axis (e.g. \"Revenue ($)\"), drawn centered along it just inside the\n * chart's edge: below the tick labels for the x axis, rotated to read bottom-to-top left of\n * them for the y axis. The chart's margin grows by `PcacChart.AXIS_LABEL_SPACE` to make room,\n * shrinking the plot area the same way a longer tick does. Not drawn on a hidden axis. Styled\n * by the theme's `.pcac-axis-label` rule.\n */\n label?: string\n\n /**\n * Min / mid / max sub labels (e.g. \"Low\" / \"Medium\" / \"High\") in their own row just outside the\n * tick labels, and inside the `label` if there is one: `min` left-aligned at the axis's start,\n * `mid` centered, `max` right-aligned at its end, so they never spill past the axis. On the\n * y axis they run bottom-to-top like the label, `min` at the bottom. The margin grows by\n * `PcacChart.AXIS_SUB_LABEL_SPACE` when any is set, shrinking the plot area. Not drawn on a\n * hidden axis. Styled by the theme's `.pcac-axis-sub-label` rule.\n */\n subLabels?: PcacAxisSubLabels\n\n /**\n * How the values along this axis are interpreted and shown - the tick labels, and the value\n * (`yAxis`) or key (`xAxis`) in the default tooltip. On the line/area/plot charts the x axis's\n * format is also what decides how a point's `key` maps to an x position (by index for the\n * default, `Decimal` and `DateTime` by the key's own value on a linear/time scale - see\n * `PcacLineAreaChartConfig`); a bar chart's category axis ignores it. Default `None`, which\n * on those charts behaves as `DatasetLength`.\n */\n format?: PcacFormatEnum = PcacFormatEnum.None\n\n /**\n * The value axis's domain: it runs from `domainMin` to `domainMax`, ignoring the data. Defaults\n * 0 and 100. Only the type of axis that has a domain to set reads them - a bar chart's category\n * axis ignores both, its value axis reads `domainMax` only (bars always grow from 0), and a\n * line/area/plot chart's x axis reads them only under the `Decimal` (numbers) and `DateTime`\n * (anything `new Date()` accepts, and required) formats - the index-based formats size the\n * axis from the data.\n */\n domainMin?: number | string = 0\n domainMax?: number | string = 100\n}\n\n/**\n * The `PcacChartMargin` type lives here rather than in chart.ts so the axis builder can take\n * one without importing the class module that imports it back.\n */\nexport interface PcacChartMargin {\n top: number;\n right: number;\n bottom: number;\n left: number;\n}\n\n/**\n * `PcacAxisConfig` with every default applied - what builders work with, so they never have to\n * null-check. `tickSize`, `label` and `subLabels` stay optional: \"not set\" is itself the meaningful\n * default (no marks, no labels).\n */\nexport type PcacResolvedAxisConfig = Required<Omit<PcacAxisConfig, 'tickSize' | 'label' | 'subLabels'>> & Pick<PcacAxisConfig, 'tickSize' | 'label' | 'subLabels'>;\n\n/** True if `axis` has at least one sub label to draw (an empty `subLabels` object counts as none). */\nexport function hasAxisSubLabels(axis: PcacAxisConfig | undefined): boolean {\n const sub = axis?.subLabels;\n return !!sub && (!!sub.min || !!sub.mid || !!sub.max);\n}\n\n/**\n * Room reserved in a margin for an axis `label`: the theme's 12px label plus a gap from the tick\n * labels. Reserved on the side the label sits on (`bottom` for x, `left` for y), and taken out\n * of the plot area, the same way a longer tick is. Change together with `.pcac-axis-label`.\n */\nexport const PCAC_AXIS_LABEL_SPACE = 18;\n\n/** Likewise for a row of `subLabels`: the theme's 11px text plus a gap (`.pcac-axis-sub-label`). */\nexport const PCAC_AXIS_SUB_LABEL_SPACE = 16;\n\n/**\n * Total margin an axis's `label` and `subLabels` take on its side. `PcacChart` reserves it and\n * the axis builder places the text by it, so the two stay in step.\n */\nexport function axisLabelSpace(axis: PcacAxisConfig | undefined): number {\n return (axis?.label ? PCAC_AXIS_LABEL_SPACE : 0) + (hasAxisSubLabels(axis) ? PCAC_AXIS_SUB_LABEL_SPACE : 0);\n}\n\n/**\n * @param showGridDefault what `showGrid` resolves to when the consumer left it unset - each chart\n * passes `true` for the axis whose grid it has always drawn and `false` for the other.\n */\nexport function resolveAxisConfig(axis?: PcacAxisConfig, showGridDefault = false): PcacResolvedAxisConfig {\n const defaults = new PcacAxisConfig();\n return {\n hide: axis?.hide ?? defaults.hide!,\n showGrid: axis?.showGrid ?? showGridDefault,\n ticks: axis?.ticks ?? defaults.ticks!,\n tickSize: axis?.tickSize,\n showLine: axis?.showLine ?? defaults.showLine!,\n label: axis?.label,\n subLabels: axis?.subLabels,\n format: axis?.format ?? defaults.format!,\n domainMin: axis?.domainMin ?? defaults.domainMin!,\n domainMax: axis?.domainMax ?? defaults.domainMax!,\n };\n}\n\n/**\n * Base configuration for every chart that has an x and y axis (bar, line, area, plot - not pie).\n */\nexport class PcacAxisChartConfig extends PcacChartConfig {\n xAxis?: PcacAxisConfig = new PcacAxisConfig()\n yAxis?: PcacAxisConfig = new PcacAxisConfig()\n}\n\nexport class PcacData {\n key: string | number | null = null\n value: string | number| null = null\n hide: boolean = false\n data: PcacData[] = []\n\n /**\n * URL (or data URI) of an image to draw at this point *in place of* its dot. Currently honored\n * by the line/area/plot charts only, on the innermost (point-level) `PcacData`; sized by the\n * chart config's `pointImage` (see `PcacLineAreaChartConfig.pointImage`). Points without one\n * keep their regular dot, so the two can be mixed within a single series.\n *\n * Optional (rather than defaulted) for the same reason as `PcacChartConfig.heightFull`: so\n * existing object-literal / JSON data doesn't have to declare it.\n */\n image?: string\n}\n\nexport enum PcacFormatEnum {\n None = 'none',\n Decimal = 'decimal',\n DatasetLength = 'datasetLength',\n Percentage = 'percentage',\n Minutes = 'minutes',\n DateTime = 'dateTime',\n Fahrenheit = 'fahrenheit',\n\n /**\n * Expectation is we will be given a range of data from 0-23\n * and we will map that to a 12 hour clock with am/pm\n * e.g. 0 = 12am, 1 = 1am, 13 = 1pm, 23 = 11pm\n */\n OneDayHours = 'oneDayHours'\n}\n\n","import { Injectable } from '@angular/core';\nimport { axisBottom, axisLeft, AxisScale, AxisDomain } from 'd3-axis';\nimport { BaseType, Selection } from 'd3-selection';\nimport { PCAC_AXIS_LABEL_SPACE, PcacChartMargin, PcacFormatEnum, PcacResolvedAxisConfig } from './chart.model';\nimport { format } from 'd3-format';\n\n/**\n * Generic over each axis's own domain type (e.g. `number` for a value axis's `ScaleLinear`,\n * `string` for a category axis's `ScaleBand`) rather than `any`, since the two axes on a chart\n * routinely have different domain types and each real D3 scale already satisfies `AxisScale`\n * structurally - no widening needed at the type level.\n */\nexport interface IPcacAxisBuilderConfig<XDomain extends AxisDomain = AxisDomain, YDomain extends AxisDomain = AxisDomain> {\n svg: Selection<SVGGElement, unknown, BaseType, unknown>;\n /** Plot area size - the axes' own lengths - and the chart's margins, which position a `label`. */\n width: number;\n height: number;\n margin: PcacChartMargin;\n xScale: AxisScale<XDomain>;\n yScale: AxisScale<YDomain>;\n /**\n * The chart's per-axis settings, defaults already applied (`resolveAxisConfig()`). `hide` skips\n * the axis entirely. `tickSize` is D3's `tickSizeInner`; left undefined, D3's default of 6\n * applies to the geometry - but the theme hides tick marks unless the axis group carries\n * `pcac-axis-tick-marks`, which is added exactly when a size is given, so an undefined size\n * means \"no visible marks, labels where they've always been\". `0` is a legitimate value (no\n * marks, labels hugging the axis), hence the `!== undefined` checks below. `showLine` adds\n * `pcac-axis-line`, which un-hides D3's `.domain` path the same way. The domain path keeps\n * D3's default 6px outer end-caps (`tickSizeOuter`), so it reads as a bracket rather than a\n * bare rule; that's D3's standard look and is left as-is. `label` and `subLabels` are drawn\n * inside the axis group (so they're raised and non-interactive along with it) - see `drawLabels`.\n * `format` picks the tick label format; `None` leaves D3's default.\n */\n xAxis: PcacResolvedAxisConfig;\n yAxis: PcacResolvedAxisConfig;\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PcacAxisBuilder {\n drawAxis<XDomain extends AxisDomain, YDomain extends AxisDomain>(config: IPcacAxisBuilderConfig<XDomain, YDomain>): void {\n this.drawXAxis(config);\n this.drawYAxis(config);\n }\n\n /**\n * Moves both axis groups to the end of the chart's `<g>`, so they paint over everything drawn\n * since `drawAxis()`. Axes are drawn first (so scales and margins are settled before content),\n * which leaves anything sitting at x = 0 - a line chart's first segment and dot, an area's fill,\n * a horizontal bar chart's bars - painting over the y axis line. Builders call this after the\n * content that should sit *under* the axes, and draw anything that should stay on top (the\n * line/area/plot charts' dots) afterwards. Safe to sit above the hover/zoom overlay rects too,\n * because the groups are `pointer-events: none` (set where each group is appended).\n */\n raiseAxes(svg: Selection<SVGGElement, unknown, BaseType, unknown>): void {\n svg.selectAll('.pcac-x-axis, .pcac-y-axis').raise();\n }\n\n drawYAxis<XDomain extends AxisDomain, YDomain extends AxisDomain>(config: IPcacAxisBuilderConfig<XDomain, YDomain>) {\n if (config.yAxis.hide) return;\n config.svg.selectAll('.pcac-y-axis').remove();\n\n const yAxis = axisLeft(config.yScale).ticks(config.yAxis.ticks);\n if (config.yAxis.tickSize !== undefined) {\n yAxis.tickSizeInner(config.yAxis.tickSize);\n }\n\n switch (config.yAxis.format) {\n case PcacFormatEnum.Percentage:\n yAxis.tickFormat(d => d + \"%\");\n break;\n case PcacFormatEnum.Minutes:\n yAxis.tickFormat((d) => d + 'm');\n break;\n case PcacFormatEnum.Fahrenheit:\n yAxis.tickFormat((d) => d + ' F');\n break;\n }\n\n const group = config.svg.append('g')\n .attr('class', 'pcac-y-axis')\n // Axes are raised above the interactive overlays (see raiseAxes) and take no mouse events\n .attr('pointer-events', 'none')\n .classed('pcac-axis-tick-marks', config.yAxis.tickSize !== undefined)\n .classed('pcac-axis-line', config.yAxis.showLine)\n .call(yAxis);\n\n this.drawLabels(group, config.yAxis, { length: config.height, outer: config.margin.left, vertical: true });\n }\n\n drawXAxis<XDomain extends AxisDomain, YDomain extends AxisDomain>(config: IPcacAxisBuilderConfig<XDomain, YDomain>) {\n if (config.xAxis.hide) return;\n config.svg.selectAll('.pcac-x-axis').remove();\n\n const xAxis = axisBottom(config.xScale).ticks(config.xAxis.ticks);\n if (config.xAxis.tickSize !== undefined) {\n xAxis.tickSizeInner(config.xAxis.tickSize);\n }\n\n switch (config.xAxis.format) {\n case PcacFormatEnum.Percentage:\n xAxis.tickFormat(d => d + \"%\");\n break;\n case PcacFormatEnum.Minutes:\n xAxis.tickFormat((d) => d + 'm');\n break;\n case PcacFormatEnum.Fahrenheit:\n xAxis.tickFormat((d) => d + ' F');\n break;\n case PcacFormatEnum.OneDayHours:\n xAxis.tickFormat((d) => {\n const h = d as number;\n const hour = h % 12 === 0 ? 12 : h % 12;\n const period = h < 12 ? 'am' : 'pm';\n return `${hour}${period}`;\n });\n break;\n case PcacFormatEnum.Decimal:\n xAxis.tickFormat((d) => format(\".2s\")(d as number));\n break;\n }\n\n const group = config.svg.append('g')\n .attr('class', 'pcac-x-axis')\n .attr('pointer-events', 'none')\n .classed('pcac-axis-tick-marks', config.xAxis.tickSize !== undefined)\n .classed('pcac-axis-line', config.xAxis.showLine)\n .attr('transform', 'translate(0,' + config.height + ')')\n .call(xAxis);\n\n this.drawLabels(group, config.xAxis, { length: config.width, outer: config.margin.bottom, vertical: false });\n }\n\n /**\n * The axis `label` and `subLabels`. Both are placed by two distances: along the axis (0 at its\n * start, `length` at its end - for the y axis, 0 is the bottom) and out from it, toward the\n * chart's edge. The label goes at the very edge (`outer`, i.e. the margin), the sub-label row\n * `PCAC_AXIS_LABEL_SPACE` inside that when there's a label. For the y axis the text is rotated\n * to read bottom-to-top, which swaps the two: after `rotate(-90)` x runs up the axis (so the\n * bottom is x = -length) and y runs left. `fill` is set explicitly because d3-axis puts\n * `fill=\"none\"` on the group; its own tick text does the same.\n */\n private drawLabels(\n group: Selection<SVGGElement, unknown, BaseType, unknown>,\n axis: PcacResolvedAxisConfig,\n layout: { length: number; outer: number; vertical: boolean }\n ): void {\n const text = (cls: string, along: number, out: number, anchor: string, content: string) => {\n group.append('text')\n .attr('class', cls)\n .attr('fill', 'currentColor')\n .attr('text-anchor', anchor)\n .attr('transform', layout.vertical ? 'rotate(-90)' : null)\n .attr('x', layout.vertical ? along - layout.length : along)\n .attr('y', layout.vertical ? -out : out)\n .attr('dy', layout.vertical ? '1em' : '-0.35em')\n .text(content);\n };\n\n if (axis.label) {\n text('pcac-axis-label', layout.length / 2, layout.outer, 'middle', axis.label);\n }\n const sub = axis.subLabels;\n if (sub) {\n const edge = layout.outer - (axis.label ? PCAC_AXIS_LABEL_SPACE : 0);\n if (sub.min) text('pcac-axis-sub-label', 0, edge, 'start', sub.min);\n if (sub.mid) text('pcac-axis-sub-label', layout.length / 2, edge, 'middle', sub.mid);\n if (sub.max) text('pcac-axis-sub-label', layout.length, edge, 'end', sub.max);\n }\n }\n}\n","import { Injectable } from '@angular/core';\nimport { BaseType, Selection } from 'd3-selection';\nimport { AxisScale, AxisDomain } from 'd3-axis';\n\n/**\n * Generic over each axis's own domain type, same rationale as `IPcacAxisBuilderConfig`.\n */\nexport interface IPcacGridBuilderConfig<XDomain extends AxisDomain = AxisDomain, YDomain extends AxisDomain = AxisDomain> {\n svg: Selection<SVGGElement, unknown, BaseType, unknown>;\n /**\n * Required for horizontal grid\n */\n width: number;\n /**\n * Required for vertical grid\n */\n height: number;\n xScale: AxisScale<XDomain>;\n yScale: AxisScale<YDomain>;\n /**\n * Tick count hint for a continuous scale (D3's `ticks(n)`); a category (band) scale ignores it\n * and gets one line per category.\n */\n numberOfTicks: number;\n}\n\n/**\n * `AxisScale` (the shape shared by every D3 scale usable here) doesn't declare `.ticks()` -\n * band scales don't have one - nor `.bandwidth()`, which only band scales have. Either kind can\n * drive a grid: a continuous scale puts a line at each tick, a band scale one through the middle\n * of each category, so `gridLines()` sniffs for `.ticks` and handles both.\n */\ntype TickableAxisScale<Domain extends AxisDomain> = AxisScale<Domain> & { ticks(count?: number): Domain[] };\ntype BandAxisScale<Domain extends AxisDomain> = AxisScale<Domain> & { bandwidth(): number };\n\n/** Where along its axis each grid line sits, in pixels. */\nfunction gridLines<Domain extends AxisDomain>(scale: AxisScale<Domain>, numberOfTicks: number): number[] {\n if (typeof (scale as TickableAxisScale<Domain>).ticks === 'function') {\n return (scale as TickableAxisScale<Domain>).ticks(numberOfTicks).map(d => scale(d) ?? 0);\n }\n const band = scale as BandAxisScale<Domain>;\n const half = typeof band.bandwidth === 'function' ? band.bandwidth() / 2 : 0;\n return scale.domain().map(d => (scale(d) ?? 0) + half);\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PcacGridBuilder {\n /**\n * Vertical lines, one per x-axis tick (or category), running the plot's full height. The group\n * is classed `pcac-grid-vertical` (the horizontal one `pcac-grid-horizontal`) so a chart can\n * find and redraw just one grid - the line/area/plot charts do on zoom, when an axis's ticks move.\n */\n drawVerticalGrid<XDomain extends AxisDomain, YDomain extends AxisDomain>(config: IPcacGridBuilderConfig<XDomain, YDomain>): void {\n config.svg.append('g')\n .attr('class', 'pcac-grid pcac-grid-vertical')\n .selectAll('g.rule')\n .data(gridLines(config.xScale, config.numberOfTicks))\n .enter().append('svg:g')\n .attr('class', 'pcac-grid-rule')\n .attr('transform', (x): string => (`translate(${x}, 0)`))\n .append('svg:line')\n .attr('y1', 0)\n .attr('y2', config.height)\n .attr('class', (d, i: number) => (i === 0 ? 'pcac-grid-rule-last' : ''));\n }\n\n /**\n * Horizontal lines, one per y-axis tick (or category), running the plot's full width.\n */\n drawHorizontalGrid<XDomain extends AxisDomain, YDomain extends AxisDomain>(config: IPcacGridBuilderConfig<XDomain, YDomain>): void {\n config.svg.append('g')\n .attr('class', 'pcac-grid pcac-grid-horizontal')\n .selectAll('g.pcac-grid-rule')\n .data(gridLines(config.yScale, config.numberOfTicks))\n .enter().append('svg:g')\n .attr('class', 'pcac-grid-rule')\n .append('svg:line')\n .attr('y1', (y) => y)\n .attr('y2', (y) => y)\n .attr('x1', 0)\n .attr('x2', config.width)\n .attr('class', (_, i) => (i === 0 ? 'pcac-grid-rule-last' : ''));\n }\n}\n","import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PcacColorService {\n private primary = '#43425d';\n private primaryLight = '#a3a1fb';\n private success = '#5ee2a0';\n private danger = '#ff6565';\n private warning = '#fec163';\n private orange = '#ffa177';\n private blue = '#55d8fe';\n private scale = [\n this.primaryLight,\n this.success,\n this.danger,\n this.warning,\n this.orange,\n this.blue\n ] as string[];\n private alert = 'red';\n\n /**\n * Get a scale of colors dynamically\n * @param numberOfNodes Number of items in dynamically build collection of colors\n */\n getColorScale(numberOfNodes: number): string[] {\n const pallette = [] as string[];\n for (let i = 0; i < numberOfNodes; i++) {\n const mark = i % this.scale.length;\n pallette.push(this.scale[mark]);\n }\n return pallette;\n }\n\n getAlert(): string {\n return this.alert;\n }\n\n /**\n * Set the scale that charts use to set colors of data[x] on the UI.\n * @param colors A collection of hex values\n */\n setScale(colors: string[]): void {\n this.scale = colors;\n }\n\n setPrimary(color: string): void {\n this.primary = color;\n }\n\n setPrimaryLight(color: string): void {\n this.primaryLight = color;\n }\n\n setSuccess(color: string): void {\n this.success = color;\n }\n\n setDanger(color: string): void {\n this.danger = color;\n }\n\n setOrange(color: string): void {\n this.orange = color;\n }\n\n setBlue(color: string): void {\n this.blue = color;\n }\n\n setAlert(color: string): void {\n this.alert = color;\n }\n}\n","import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PcacTransitionService {\n private transitionDuration = 750;\n\n getTransitionDuration(): number {\n return this.transitionDuration;\n }\n}\n","import { ApplicationRef, EmbeddedViewRef, Injectable, TemplateRef, inject } from '@angular/core';\nimport { PcacData, PcacFormatEnum } from './chart.model';\nimport { PcacTooltipContext } from './tooltip.directive';\nimport { select } from 'd3';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PcacTooltipBuilder {\n private appRef = inject(ApplicationRef);\n\n /**\n * One tooltip element shared by every chart on the page, appended to `<body>` so it can float\n * over anything. It's only ever a positioning shell: the default look (`.pcac-d3-tooltip-default`)\n * is toggled on when the library renders its own key/value content and off when a consumer's\n * `<ng-template pcacTooltip>` is rendered into it instead, so a custom template owns the whole box.\n */\n public tooltip = select('body')\n .append('div')\n .attr('class', 'pcac-d3-tooltip');\n\n /**\n * The consumer template currently rendered into the shell, if any. Created on the first show\n * of a hover and torn down in `hideTooltip()` - not kept around between hovers - so a view is\n * never left holding onto a declaring component that has since been destroyed (e.g. after a\n * route change). While it lives, repeated `mousemove`s just update its context in place.\n */\n private view: EmbeddedViewRef<PcacTooltipContext> | null = null;\n private viewTemplate: TemplateRef<PcacTooltipContext> | null = null;\n\n /**\n * Shows the tooltip for a hovered datum at the event's position. Renders `template` when the\n * chart has one projected; otherwise falls back to the default key/value content, formatted per\n * `valueFormat`/`keyFormat`.\n */\n showTooltip(\n event: MouseEvent,\n template: TemplateRef<PcacTooltipContext> | undefined,\n context: PcacTooltipContext,\n valueFormat?: PcacFormatEnum,\n keyFormat?: PcacFormatEnum\n ): void {\n if (template) {\n this.renderTemplate(template, context);\n } else {\n this.renderDefault(context.$implicit, valueFormat, keyFormat);\n }\n this.position(event);\n }\n\n /**\n * @deprecated Builders should call `PcacChart.showTooltip()`, which routes through a chart's\n * projected `pcacTooltip` template. This only ever renders the default content.\n */\n showBarTooltip(event: MouseEvent, data: PcacData, valueFormat?: PcacFormatEnum, keyFormat?: PcacFormatEnum): void {\n this.showTooltip(event, undefined, { $implicit: data, parent: null, isThreshold: false, index: 0, parentIndex: null, coincident: [] }, valueFormat, keyFormat);\n }\n\n hideTooltip(): void {\n this.tooltip.style('display', 'none');\n this.destroyView();\n }\n\n private renderDefault(data: PcacData, valueFormat?: PcacFormatEnum, keyFormat?: PcacFormatEnum): void {\n this.destroyView();\n this.tooltip\n .classed('pcac-d3-tooltip-default', true)\n .html(this.getBarTipData(data, valueFormat, keyFormat));\n }\n\n private renderTemplate(template: TemplateRef<PcacTooltipContext>, context: PcacTooltipContext): void {\n if (this.view && this.viewTemplate === template) {\n // Same hover, new mouse position/datum: keep the view and just refresh what it's bound to.\n Object.assign(this.view.context, context);\n } else {\n this.destroyView();\n this.tooltip.classed('pcac-d3-tooltip-default', false).html(null);\n\n // Same technique as the CDK's DomPortalOutlet: create the view off-tree, attach it to the\n // app so it takes part in change detection (a template reading a signal keeps updating\n // while shown), then physically move its nodes into the shell. The view's own injector is\n // the declaring component's, so pipes/DI in the template resolve as they would in place.\n this.view = template.createEmbeddedView(context);\n this.viewTemplate = template;\n this.appRef.attachView(this.view);\n const shell = this.tooltip.node() as HTMLDivElement;\n for (const node of this.view.rootNodes) {\n shell.appendChild(node);\n }\n }\n // The trigger is a D3-native mouse listener, which nothing in Angular observes under zoneless\n // change detection, so the view has to be checked explicitly for the new context to render\n // before it's measured for positioning.\n this.view.detectChanges();\n }\n\n private destroyView(): void {\n if (!this.view) {\n return;\n }\n // `destroy()` also detaches the view from the ApplicationRef it was attached to, but it\n // doesn't pull the nodes we moved into the shell back out of the DOM - that's what a\n // ViewContainerRef would normally do on removal - so the shell is emptied here explicitly.\n this.view.destroy();\n this.view = null;\n this.viewTemplate = null;\n this.tooltip.html(null);\n }\n\n /**\n * Centers the (already rendered) tooltip horizontally on the cursor and sits it just above.\n * Measured from the real box rather than fixed offsets so it works for content of any size.\n */\n private position(event: MouseEvent): void {\n const shell = this.tooltip.style('display', 'inline-block').node() as HTMLDivElement;\n this.tooltip\n .style('left', event.pageX - shell.offsetWidth / 2 + 'px')\n .style('top', event.pageY - shell.offsetHeight - 8 + 'px');\n }\n\n private getBarTipData(data: PcacData, valueFormat?: PcacFormatEnum, keyFormat?: PcacFormatEnum): string | null {\n let value = data.value;\n let key = data.key\n\n if (valueFormat) {\n switch (valueFormat) {\n case PcacFormatEnum.Percentage:\n value = value as number * 100 + '%';\n break;\n case PcacFormatEnum.Fahrenheit:\n value = `${value} F`;\n break;\n }\n }\n\n if (key && keyFormat) {\n switch (keyFormat) {\n case PcacFormatEnum.DateTime:\n key = new Date(key).toLocaleDateString('en-US', {\n day: '2-digit',\n month: '2-digit',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit'\n })\n break;\n }\n }\n\n const finalValue = value ? value.toString() : value;\n\n return key ? key + '<br>' + finalValue : `${finalValue}`;\n }\n}\n","import { axisLeft, AxisDomain, AxisScale } from 'd3-axis';\nimport { BaseType, Selection } from 'd3-selection';\nimport { IPcacAxisBuilderConfig, PcacAxisBuilder } from './axis.builder';\nimport { PcacGridBuilder } from './grid.builder';\nimport { PcacColorService } from './color.service';\nimport { select } from 'd3-selection';\nimport { ElementRef, TemplateRef, inject } from '@angular/core';\nimport { PCAC_AXIS_LABEL_SPACE, PCAC_AXIS_SUB_LABEL_SPACE, PcacAxisChartConfig, PcacChartConfig, PcacChartMargin, PcacData, PcacFormatEnum, PcacResolvedAxisConfig, axisLabelSpace, resolveAxisConfig } from './chart.model';\nimport { PcacTransitionService } from './transition.service';\nimport { PcacTooltipBuilder } from './tooltip.builder';\nimport { PcacTooltipCoincident, PcacTooltipContext } from './tooltip.directive';\n\n/**\n * Everything `showTooltip()` needs beyond the hovered datum itself. `parent`/`isThreshold` feed\n * the consumer template's context; the formats only apply to the default (no template) content.\n */\nexport interface PcacTooltipOptions {\n /** See `PcacTooltipContext.index`. Required so no hover site can forget to supply it. */\n index: number;\n parent?: PcacData | null;\n /** See `PcacTooltipContext.parentIndex`. Defaults to `null`, matching `parent`'s default. */\n parentIndex?: number | null;\n isThreshold?: boolean;\n /** See `PcacTooltipContext.coincident`. Defaults to none. */\n coincident?: PcacTooltipCoincident[];\n valueFormat?: PcacFormatEnum;\n keyFormat?: PcacFormatEnum;\n}\n\n\nexport class PcacChart {\n axisBuilder = inject(PcacAxisBuilder);\n gridBuilder = inject(PcacGridBuilder);\n transitionService = inject(PcacTransitionService);\n tooltipBuilder = inject(PcacTooltipBuilder);\n colorService = inject(PcacColorService);\n\n /** D3's own `tickSizeInner` default, which the default `margin` below is sized around. */\n static readonly DEFAULT_TICK_SIZE = 6;\n\n /** See `PCAC_AXIS_LABEL_SPACE` / `PCAC_AXIS_SUB_LABEL_SPACE` in chart.model.ts. */\n static readonly AXIS_LABEL_SPACE = PCAC_AXIS_LABEL_SPACE;\n static readonly AXIS_SUB_LABEL_SPACE = PCAC_AXIS_SUB_LABEL_SPACE;\n\n margin: PcacChartMargin = { top: 8, right: 16, bottom: 20, left: 40 };\n private readonly defaultMargin: PcacChartMargin = { ...this.margin };\n\n /**\n * The current build's per-axis settings with defaults applied, set by `initializeAxisState()`.\n * Builders read these (not the raw `config.xAxis`) everywhere: drawing the axes, choosing\n * whether to draw a grid, how many grid lines, and so on. Pie has no axes and never sets them.\n */\n xAxis: PcacResolvedAxisConfig = resolveAxisConfig();\n yAxis: PcacResolvedAxisConfig = resolveAxisConfig();\n svg!: Selection<SVGGElement, unknown, BaseType, unknown>;\n width = 400;\n height = 400;\n colors = [] as string[];\n startData: PcacData[] = [];\n\n /**\n * Raw, unadjusted container width measured by the last successful `initializeChartState()`\n * call, or `null` if none has succeeded yet. Deliberately tracked separately from `width`:\n * some builders (e.g. bar-horizontal-chart's `setHorizontalMarginsBasedOnContent`) recompute\n * `width`/`margin.left` mid-build from measured axis-label sizes, so `width` alone isn't a\n * stable basis for \"did the container itself resize\" — the raw container measurement is.\n */\n private lastContainerWidth: number | null = null;\n\n /**\n * Raw container height measured by the last successful `initializeChartState()` call, and\n * whether that build was running with `heightFull` on. Only consulted by `containerSizeChanged`\n * when it was: without `heightFull` the container's height is driven *by* the chart's own SVG\n * height, so comparing it would report \"changed\" every time the chart itself grew or shrank.\n */\n private lastContainerHeight: number | null = null;\n private lastHeightFull = false;\n\n /**\n * How much the vertical margins have grown this build beyond their defaults - for tick marks\n * and axis labels (`initializeAxisState()`; negative when a short tick took some away) and for\n * content that hangs past the plot's edge (`reserveEdgeSpace()`). `resolveHeight()` subtracts\n * it from the plot height so the SVG's total height doesn't change with any of them. Reset\n * alongside the margins.\n */\n private reservedHeight = 0;\n\n /**\n * Resolves the consumer's projected `<ng-template pcacTooltip>`, if any. Each chart component\n * points this at its own `contentChild(PcacTooltipDirective)` query. It's a getter rather than\n * a captured value so it's read lazily, at hover time, from inside a D3 listener: reading the\n * query signal in the component's build effect instead would make the effect depend on it and\n * rebuild the whole chart (restarting its entry animation) whenever the query resolves.\n */\n tooltipTemplate: () => TemplateRef<PcacTooltipContext> | undefined = () => undefined;\n\n /**\n * Puts `margin` back to its defaults. `initializeAxisState()` calls this first thing, before any\n * per-build adjustment (hidden axes giving sides back, tick sizes growing them, label widths\n * measured into `margin.left`): `margin` lives on this per-chart instance and so persists\n * between builds, and without a reset an adjustment made for one config silently carries into\n * the next - e.g. axes drawn with no room after `hide` flips back to false.\n */\n resetMargin(): void {\n this.margin = { ...this.defaultMargin };\n this.reservedHeight = 0;\n }\n\n /**\n * Resolves the config's `xAxis`/`yAxis` onto this chart and sets the margins up for them. Axis\n * charts call this at the top of `buildChart()`, on their own copy of the config (it rewrites\n * `config.height` for hidden axes), before `initializeChartState()` measures the plot area.\n * In order:\n *\n * 1. `resetMargin()`.\n * 2. Tick marks: room for a non-default `tickSize` is reserved on each axis that will actually\n * be drawn (`reserveTickSizeMargins`).\n * 3. Labels: `AXIS_LABEL_SPACE` is added to `bottom` / `left` for an axis with a `label`, and\n * `AXIS_SUB_LABEL_SPACE` for one with any `subLabels` (see `axisLabelSpace`), again only if\n * the axis will be drawn.\n * 4. Hidden axes: an axis with `hide` gives its margins back to the plot. The y axis owns\n * `left` and `top` (the top margin is only there so the topmost y label isn't clipped), the\n * x axis `bottom` and `right` (likewise for the rightmost x label). Each reclaimed vertical\n * margin is added onto `config.height` so the SVG's total height stays what the consumer\n * configured; horizontally `initializeChartState()` picks the change up on its own.\n *\n * @param defaultGrid the axis whose grid this chart draws when the consumer hasn't said\n * (`PcacAxisConfig.showGrid`): `'y'` for horizontal lines, `'x'` for vertical.\n * @param hiddenAxisMargin what a hidden axis's sides shrink to, rather than 0. The\n * line/area/plot charts keep 8px so a dot on the edge of the plot isn't clipped by the SVG.\n */\n initializeAxisState(config: PcacAxisChartConfig, defaultGrid: 'x' | 'y', hiddenAxisMargin = 0): void {\n this.xAxis = resolveAxisConfig(config.xAxis, defaultGrid === 'x');\n this.yAxis = resolveAxisConfig(config.yAxis, defaultGrid === 'y');\n this.resetMargin();\n this.reserveTickSizeMargins(\n this.xAxis.hide ? undefined : this.xAxis.tickSize,\n this.yAxis.hide ? undefined : this.yAxis.tickSize\n );\n if (!this.xAxis.hide) {\n const space = axisLabelSpace(this.xAxis);\n this.margin.bottom += space;\n this.reservedHeight += space;\n }\n if (!this.yAxis.hide) {\n this.margin.left += axisLabelSpace(this.yAxis);\n }\n if (this.yAxis.hide) {\n config.height = config.height + this.margin.top - hiddenAxisMargin;\n this.margin.top = hiddenAxisMargin;\n this.margin.left = hiddenAxisMargin;\n }\n if (this.xAxis.hide) {\n config.height = config.height + this.margin.bottom - hiddenAxisMargin;\n this.margin.bottom = hiddenAxisMargin;\n this.margin.right = hiddenAxisMargin;\n }\n }\n\n /**\n * The `PcacAxisBuilder` config for this chart's current state - everything but the scales is\n * already on the instance. Builders pass the result to `drawAxis()` (or `drawXAxis()` with a\n * rescaled x, on zoom).\n */\n axisBuilderConfig<XDomain extends AxisDomain, YDomain extends AxisDomain>(\n xScale: AxisScale<XDomain>, yScale: AxisScale<YDomain>\n ): IPcacAxisBuilderConfig<XDomain, YDomain> {\n return {\n svg: this.svg,\n width: this.width,\n height: this.height,\n margin: this.margin,\n xScale,\n yScale,\n xAxis: this.xAxis,\n yAxis: this.yAxis\n };\n }\n\n /**\n * Draws whichever grids the resolved axes ask for: vertical lines from the x axis's ticks,\n * horizontal from the y's (`PcacAxisConfig.showGrid`). `which` restricts it to one axis - the\n * line/area/plot charts redraw just a zoomed axis's grid against its rescaled scale on zoom.\n */\n drawGrids<XDomain extends AxisDomain, YDomain extends AxisDomain>(\n xScale: AxisScale<XDomain>, yScale: AxisScale<YDomain>, which: 'x' | 'y' | 'both' = 'both'\n ): void {\n const base = { svg: this.svg, width: this.width, height: this.height, xScale, yScale };\n if (which !== 'y' && this.xAxis.showGrid) {\n this.gridBuilder.drawVerticalGrid({ ...base, numberOfTicks: this.xAxis.ticks });\n }\n if (which !== 'x' && this.yAxis.showGrid) {\n this.gridBuilder.drawHorizontalGrid({ ...base, numberOfTicks: this.yAxis.ticks });\n }\n }\n\n /**\n * Makes room in the margins for tick marks longer (or shorter) than D3's default. The default\n * margins are sized around that default (`DEFAULT_TICK_SIZE`), and D3 places each tick label at\n * tick length + padding, so a longer tick pushes its labels outward by exactly the difference -\n * into space the margin doesn't have unless it grows by the same amount. Growing the margin here,\n * *before* `initializeChartState()` measures the plot area, is what makes the chart shrink to fit\n * its labels rather than pushing them off the edge of the SVG. A shorter tick hands the\n * difference back to the plot area the same way.\n *\n * Horizontally that happens on its own: `initializeChartState()` derives `width` from the\n * container minus the margins. Vertically it doesn't - `config.height` is the plot area, and\n * the SVG is that plus the margins - so a taller bottom margin would grow the SVG instead. The\n * delta is therefore also remembered in `reservedHeight` and taken back out of the plot\n * height by `resolveHeight()`, keeping the chart's total footprint where the consumer put it.\n *\n * Called by `initializeAxisState()` right after `resetMargin()`, for the axes that will be\n * drawn. Only the axis a tick size is given for is affected; `undefined` leaves that margin\n * alone.\n * @param xTickSize `tickSizeInner` for the bottom (x) axis, which lives in `margin.bottom`\n * @param yTickSize `tickSizeInner` for the left (y) axis, which lives in `margin.left`\n */\n reserveTickSizeMargins(xTickSize?: number, yTickSize?: number): void {\n if (xTickSize !== undefined) {\n const bottom = Math.max(0, this.margin.bottom + xTickSize - PcacChart.DEFAULT_TICK_SIZE);\n this.reservedHeight = bottom - this.margin.bottom;\n this.margin.bottom = bottom;\n }\n if (yTickSize !== undefined) {\n this.margin.left = Math.max(0, this.margin.left + yTickSize - PcacChart.DEFAULT_TICK_SIZE);\n }\n }\n\n /**\n * Makes sure each given margin is at least that big, for content drawn at the very edge of the\n * plot area that reaches past it - a point image on the line/area/plot charts, say, whose box\n * is centered on a point at the top of the y domain and so hangs half of itself above the plot.\n * Those charts already widen their clip-path to let such a point through; this is what stops\n * the `<svg>` itself from cutting it off, the SVG being only the plot area plus the margins.\n *\n * \"At least\", not \"add\": the default margins, and any tick / label room already reserved in\n * them, may well cover it already (`margin.left` is 40 by default), and adding on top of that\n * would give up plot area for nothing. Vertical growth is taken out of the plot height the same\n * way `reserveTickSizeMargins()`'s is, so the SVG's total height stays what the consumer\n * configured; horizontally `initializeChartState()` picks the change up on its own. A side\n * left `undefined` is untouched.\n *\n * Call after `initializeAxisState()` (which resets the margins) and before\n * `initializeChartState()` (which measures the plot area against them).\n */\n reserveEdgeSpace(space: Partial<PcacChartMargin>): void {\n for (const side of ['top', 'right', 'bottom', 'left'] as const) {\n const wanted = space[side];\n if (wanted === undefined || wanted <= this.margin[side]) {\n continue;\n }\n if (side === 'top' || side === 'bottom') {\n this.reservedHeight += wanted - this.margin[side];\n }\n this.margin[side] = wanted;\n }\n }\n\n /**\n * Shows the tooltip for a hovered datum, through the chart's `pcacTooltip` template when one is\n * projected and the default key/value content otherwise. Every builder's hover handler should\n * go through here rather than `tooltipBuilder` directly so the template is honored everywhere.\n */\n showTooltip(event: MouseEvent, data: PcacData, options: PcacTooltipOptions): void {\n this.tooltipBuilder.showTooltip(\n event,\n this.tooltipTemplate(),\n {\n $implicit: data,\n parent: options.parent ?? null,\n isThreshold: options.isThreshold ?? false,\n index: options.index,\n parentIndex: options.parentIndex ?? null,\n coincident: options.coincident ?? [],\n },\n options.valueFormat,\n options.keyFormat\n );\n }\n\n hideTooltip(): void {\n this.tooltipBuilder.hideTooltip();\n }\n\n /**\n * Prior to building a chart, we need to initialize the state of the chart.\n *\n * Returns `false` (and leaves `width`/`height`/`colors` untouched) if the container hasn't\n * been laid out yet, so its `clientWidth` measures 0 — this happens when a chart mounts\n * already holding data (e.g. behind a loading gate) and its first `ngOnChanges` fires before\n * the browser has committed layout for its own just-created DOM node. Callers should bail out\n * of their build on `false` rather than proceeding with a degenerate width; `PcacChartResizeService`\n * (wired up by every chart component) retries the build once the container has a real size.\n * @param chartElm Reference to SVG on dom\n * @param config Chart specific configuration\n */\n initializeChartState(chartElm: ElementRef, config: PcacChartConfig): boolean {\n select(chartElm.nativeElement).select('g').remove();\n const container = chartElm.nativeElement.parentNode as HTMLElement;\n const containerWidth = container.clientWidth;\n const measuredWidth = containerWidth - this.margin.left - this.margin.right;\n if (measuredWidth <= 0) {\n return false;\n }\n this.width = measuredWidth;\n this.height = this.resolveHeight(container, config);\n this.colors = this.colorService.getColorScale(Math.max(config.data.length, config.data[0]?.data ? config.data[0].data.length : 0));\n this.lastContainerWidth = containerWidth;\n this.lastContainerHeight = container.clientHeight;\n this.lastHeightFull = config.heightFull === true;\n return true;\n }\n\n /**\n * `config.height` normally *is* the height of the drawing area. With `config.heightFull` on it\n * becomes a floor instead: the chart fills its container, and only falls back to `config.height`\n * when the container is shorter than that (or has no definite height of its own to fill - see\n * `PcacChartConfig.heightFull`, where an auto-height container measures ~0 here and the\n * `Math.max` keeps the configured height).\n *\n * Note this deliberately subtracts the margins, so it's the *total* SVG that ends up matching\n * the container: `buildContainer()` adds `margin.top`/`margin.bottom` back on top of `height`\n * when sizing the `<svg>`, so filling without this would overflow the container by exactly the\n * vertical margins.\n * @param container The chart's container element (the `<svg>`'s parent)\n * @param config Chart specific configuration\n */\n private resolveHeight(container: HTMLElement, config: PcacChartConfig): number {\n // See `reserveTickSizeMargins()` / `reserveEdgeSpace()`: room made in the vertical margins\n // comes out of the plot area, not added on to the SVG. Applies to the floor in the `heightFull`\n // case too, for the same reason.\n const height = Math.max(0, config.height - this.reservedHeight);\n if (!config.heightFull) {\n return height;\n }\n return Math.max(height, container.clientHeight - this.margin.top - this.margin.bottom);\n }\n\n /**\n * True if the container's current raw layout width differs from the one measured by the last\n * successful build, or if no successful build has happened yet. For a `heightFull` chart, a\n * change in the container's height counts too - that's the whole size the chart is tracking.\n *\n * `PcacChartResizeService`'s `ResizeObserver` is guaranteed to fire once as soon as it starts\n * observing — that's what lets a chart recover from the 0-width race described on\n * `initializeChartState`, but it also means that \"routine\" first callback usually lands\n * moments after `ngOnChanges` already built successfully at the same width. Without this\n * check, that redundant callback would restart the chart's enter transition mid-animation for\n * no visual change. Only `ngOnChanges` (which reacts to data, not size) should skip this check.\n * @param chartElm Reference to SVG on dom\n */\n containerSizeChanged(chartElm: ElementRef): boolean {\n if (this.lastContainerWidth === null) {\n return true;\n }\n const container = chartElm.nativeElement.parentNode as HTMLElement;\n const containerWidth = container.clientWidth;\n if (containerWidth > 0 && containerWidth !== this.lastContainerWidth) {\n return true;\n }\n if (!this.lastHeightFull) {\n return false;\n }\n // Height only matters for a `heightFull` chart, and only there is it safe to compare: the\n // container's height is definite (see `resolveHeight`), so it changes when the *layout*\n // changes, not in response to the height this chart just drew itself at.\n const containerHeight = container.clientHeight;\n return containerHeight > 0 && containerHeight !== this.lastContainerHeight;\n }\n\n /**\n * 1) Set the width and height of the SVG\n * 2) Add a group and translate it to state of {{center}} option\n * @param chartElm Reference to SVG on dom\n * @param center Are we pinning x,y to the top,left, or are we centering our drawing group inside the SVG.\n */\n buildContainer(chartElm: ElementRef, center = false): void {\n const combinedHeight = this.height + this.margin.top + this.margin.bottom;\n const combinedWidth = this.width + this.margin.left + this.margin.right;\n this.svg = select(chartElm.nativeElement)\n .attr('width', combinedWidth)\n .attr('height', combinedHeight);\n if (center) {\n this.svg = this.svg\n .append('g')\n .attr('transform', 'translate(' + combinedWidth / 2 + ',' + combinedHeight / 2 + ')');\n return;\n }\n this.svg = this.svg\n .append('g')\n .attr('transform', 'translate(' + this.margin.left + ',' + this.margin.top + ')');\n }\n\n /**\n * Most charts share a default margin(s) state.\n * In some cases, that state needs to be calculated based on the content that resides in that margin.\n * For example, labels on a horizontal bar chart are dynamic and such the margin needs to be calculated ahead of\n * chart axis construction.\n *\n * Measures with the y axis's own `tickSize` (the measured box spans the tick line as well as\n * the label, so measuring at a different length would put the labels off by the difference)\n * and adds its `axisLabelSpace()` back on top, since the measurement replaces whatever\n * `initializeAxisState()` reserved for the label / sub labels.\n * @param chartElm Reference to SVG on dom\n * @param yScale D3 scale transformation object (d3.ScaleBand)\n */\n setHorizontalMarginsBasedOnContent<Domain extends AxisDomain>(chartElm: ElementRef, yScale: AxisScale<Domain>): void {\n const axisY = axisLeft(yScale).ticks(5);\n if (this.yAxis.tickSize !== undefined) {\n axisY.tickSizeInner(this.yAxis.tickSize);\n }\n let max = 0;\n select(chartElm.nativeElement).append('g')\n .call(axisY)\n .each((d, i, n) => {\n const width = (n[i] as SVGGraphicsElement).getBBox().width;\n if (width > max) {\n max = width;\n }\n })\n .remove();\n // `width` was already computed net of the current `margin.left` by initializeChartState(),\n // so only the *change* in margin comes out of it. Subtracting the whole measured margin\n // double-counted it, and since `margin` persists on the builder between builds, the amount\n // double-counted grew on the next rebuild - the plot area came out narrower than the\n // container allowed and then shrank further after the first resize.\n const left = max + axisLabelSpace(this.yAxis);\n this.width = this.width + this.margin.left - left;\n this.margin.left = left;\n }\n}\n","import { PcacData } from './chart.model';\n\n/**\n * Where each bar of a stacked group starts: the running total of the bars before it, in data\n * order, so the first bar sits on the baseline and each later one on top of the previous. Values\n * are the bar's *own* size (segment), not a pre-accumulated total; a null value counts as 0.\n *\n * Keyed by the bar's own `PcacData` object so D3 callbacks (which only get the datum) can look\n * their offset up directly.\n */\nexport function stackStarts(groups: PcacData[]): Map<PcacData, number> {\n const starts = new Map<PcacData, number>();\n for (const group of groups) {\n let total = 0;\n for (const bar of group.data) {\n starts.set(bar, total);\n total += Number(bar.value ?? 0);\n }\n }\n return starts;\n}\n","import { Injectable, ElementRef } from '@angular/core';\nimport { color } from 'd3-color';\nimport { scaleBand, ScaleBand, scaleLinear, ScaleLinear } from 'd3-scale';\nimport { select, Selection } from 'd3-selection';\nimport { BaseType } from 'd3-selection';\nimport { Subject } from 'rxjs';\n\n/**\n * Lib\n */\nimport { PcacBarHorizontalChartConfig } from './bar-horizontal-chart.model';\nimport { PcacChart } from '../../core/chart';\nimport { PcacData } from '../../core/chart.model';\nimport { stackStarts } from '../../core/stack';\n\n// `BaseType` (not the hand-rolled union this used to be, which omitted `null` and never\n// actually matched what `.selectAll()`'s default generics resolve to).\ntype GroupType = Selection<BaseType, PcacData, BaseType, PcacData>;\n\n/**\n * Provided per-component (see PcacBarHorizontalChartComponent's `providers`), not root-scoped:\n * this builder extends PcacChart, which holds mutable per-chart-instance state (margin, width,\n * height, colors, svg). A root singleton would be shared and clobbered by every\n * <pcac-bar-horizontal-chart> rendered at once.\n */\n@Injectable()\nexport class BarHorizontalChartBuilder extends PcacChart {\n private xScale!: ScaleLinear<number, number>;\n private yScaleStacked!: ScaleBand<string>;\n private yScaleGrouped!: ScaleBand<string>;\n private barClickedSource = new Subject<PcacData>();\n private config!: PcacBarHorizontalChartConfig;\n barClicked$ = this.barClickedSource.asObservable();\n\n buildChart(chartElm: ElementRef, config: PcacBarHorizontalChartConfig): void {\n if (!config?.data?.length) {\n return;\n }\n\n this.config = JSON.parse(JSON.stringify(config));\n this.initializeAxisState(this.config, 'x');\n if (!this.initializeChartState(chartElm, this.config)) {\n return;\n }\n\n // Copy before reversing: `.reverse()` is in place, and this is the consumer's own array -\n // reversing it directly flipped their palette on every rebuild (i.e. every resize).\n if (config.colorOverride && config.colorOverride.colors) {\n this.colors = [...config.colorOverride.colors].reverse();\n }\n this.buildScales(chartElm, this.config);\n this.drawChart(chartElm, this.config);\n }\n\n private buildScales(chartElm: ElementRef, config: PcacBarHorizontalChartConfig) {\n config.data[0].data.map((d) => {\n return d.value;\n });\n\n // Bars grow from 0, so only `domainMax` is read; `xAxis.domainMin` is ignored.\n this.xScale = scaleLinear()\n .domain([0, this.xAxis.domainMax as number]);\n\n\n this.yScaleStacked = scaleBand()\n .domain(config.data.map((d) => d.key as string))\n .range([this.height, 0])\n .padding(0.1);\n\n this.yScaleGrouped = scaleBand()\n .padding(0.05)\n .rangeRound([0, this.yScaleStacked.bandwidth()])\n .domain(config.data[0].data.map((d) => d.key as string));\n\n // The left margin is sized to the y axis's labels - unless there is no y axis to size it to\n if (!this.yAxis.hide) {\n this.setHorizontalMarginsBasedOnContent(chartElm, this.yScaleStacked);\n }\n\n this.xScale.range([0, this.width]);\n }\n\n private drawChart(chartElm: ElementRef, config: PcacBarHorizontalChartConfig): void {\n this.buildContainer(chartElm);\n this.axisBuilder.drawAxis(this.axisBuilderConfig(this.xScale, this.yScaleStacked));\n this.drawGrids(this.xScale, this.yScaleStacked);\n this.addGroups(config);\n this.axisBuilder.raiseAxes(this.svg);\n }\n\n private addGroups(config: PcacBarHorizontalChartConfig) {\n const groupsContainer = this.svg.append('g')\n .attr('class', 'pcac-bars')\n .selectAll('g')\n .data(config.data)\n .enter().append('g')\n .attr('class', 'pcac-bar-group')\n .attr('data-group-id', (d: PcacData, i: number) => {\n return i;\n })\n .attr('transform', (d: PcacData) => 'translate(0,' + this.yScaleStacked(d.key as string) + ')');\n\n const group = groupsContainer.selectAll('rect')\n .data((d: PcacData) => {\n return d.data;\n });\n\n this.drawBarsPerGroup(group, config);\n\n // We have no thresholds to draw\n if (!config.thresholds) {\n return;\n }\n\n // Draw threshold across entire chart\n if (config.thresholds.length === 1 && !config.thresholds[0].data) {\n this.drawThresholdAcrossChart(config);\n }\n\n // Draw threshold across each group\n if (config.thresholds.length > 1 && (!config.thresholds[0].data || config.isStacked)) {\n this.drawThresholdsPerGroup(group, config);\n }\n\n // Draw threshold across each bar in group\n if (config.thresholds.length > 1 && config.thresholds[0].data && !config.isStacked) {\n this.drawThresholdsPerBarInGroup(group, config);\n }\n }\n\n private drawBarsPerGroup(groups: GroupType, config: PcacBarHorizontalChartConfig) {\n const self = this;\n // Stacked bars start where the previous bar in their group ends; every other layout draws\n // from the baseline (start 0).\n const starts = config.isStacked ? stackStarts(config.data) : new Map<PcacData, number>();\n const startOf = (d: PcacData) => starts.get(d) ?? 0;\n const endOf = (d: PcacData) => startOf(d) + Number(d.value ?? 0);\n groups.enter().append('rect')\n .attr('class', 'pcac-bar')\n .attr('x', (d: PcacData) => this.xScale(startOf(d)))\n .attr('y', (d: PcacData) => {\n const value = !config.isStacked ? this.yScaleGrouped(d.key as string) : this.yScaleStacked(d.key as string)\n return value ? value : 0;\n })\n .attr('data-group-bar-id', (_: PcacData, i: number) => {\n return i;\n })\n .attr('height', !config.isStacked ? this.yScaleGrouped.bandwidth() : this.yScaleStacked.bandwidth())\n .style('fill', (d: PcacData, i: number, n: any) => {\n if (config.spreadColorsPerGroup) {\n const groupIndex = parseInt(n[0].parentNode.getAttribute('data-group-id'), 10);\n return this.colors[groupIndex];\n }\n return this.colors[i];\n })\n .attr('width', 0)\n .on('mouseover', function (this: any) {\n select(this)\n .transition()\n .duration(self.transitionService.getTransitionDuration() / 7.5)\n .style('fill', () => {\n if (config.spreadColorsPerGroup) {\n const groupIndex = parseInt(this.parentNode.getAttribute('data-group-id'), 10);\n const c = color(self.colors[groupIndex])\n const ct = c ? c.darker(1).toString() : self.colors[groupIndex]\n return ct\n }\n const groupIndex = parseInt(this.getAttribute('data-group-bar-id'), 10);\n const c = color(self.colors[groupIndex])\n const ct = c ? c.darker(1).toString() : self.colors[groupIndex]\n return ct\n });\n })\n .on('mousemove', function (this: SVGRectElement, event: MouseEvent, d: PcacData) {\n const groupIndex = Number((this.parentNode as Element).getAttribute('data-group-id'));\n const index = Number(this.getAttribute('data-group-bar-id'));\n self.showTooltip(event, d, { index, parent: config.data[groupIndex], parentIndex: groupIndex, valueFormat: self.xAxis.format });\n })\n .on('mouseout', function (this: any) {\n self.hideTooltip();\n select(this)\n .transition()\n .duration(self.transitionService.getTransitionDuration() / 5)\n .style('fill', () => {\n if (config.spreadColorsPerGroup) {\n const groupIndex = parseInt(this.parentNode.getAttribute('data-group-id'), 10);\n return self.colors[groupIndex];\n }\n const groupIndex = parseInt(this.getAttribute('data-group-bar-id'), 10);\n return self.colors[groupIndex];\n });\n })\n .on('click', (_event: MouseEvent, d: PcacData) => {\n this.barClickedSource.next(d);\n })\n .transition()\n .duration(this.transitionService.getTransitionDuration())\n .attr('width', (d: PcacData) => {\n return this.xScale(endOf(d)) - this.xScale(startOf(d));\n });\n }\n\n private drawThresholdAcrossChart(config: PcacBarHorizontalChartConfig) {\n this.applyPreTransitionThresholdStyles(this.svg.select('.pcac-bars').append('rect'))\n .attr('height', this.height)\n .attr('data-group-threshold-id', (_: unknown, i: number) => {\n return i;\n })\n .on('mousemove', (event: MouseEvent) => {\n this.showTooltip(event, config.thresholds[0], { index: 0, isThreshold: true, valueFormat: this.xAxis.format });\n })\n .transition()\n .duration(this.transitionService.getTransitionDuration())\n .attr('x', (_: unknown, i: number) => {\n return this.xScale(config.thresholds[i].value as number);\n });\n }\n\n private drawThresholdsPerGroup(group: GroupType, config: PcacBarHorizontalChartConfig) {\n const self = this\n this.applyPreTransitionThresholdStyles(this.svg.selectAll('.pcac-bar-group').append('rect'))\n .attr('height', this.yScaleStacked.bandwidth())\n .attr('data-group-threshold-id', (_: unknown, i: number) => {\n return i;\n })\n .on('mousemove', function (this: any, event: MouseEvent) {\n const index = Number(this.parentElement.dataset['groupId'])\n const threshold = config.thresholds[index];\n // A threshold's own PcacData is typically just a value, so its parent is the *data* group\n // it's drawn against (which has the key) rather than the threshold entry it came from.\n self.showTooltip(\n event,\n config.isStacked ? threshold.data[0] : threshold,\n { index, parent: config.data[index], parentIndex: index, isThreshold: true, valueFormat: self.xAxis.format }\n );\n })\n .transition()\n .duration(this.transitionService.getTransitionDuration())\n .attr('x', (_: unknown, i: number) => {\n return this.xScale(config.isStacked ? config.thresholds[i].data[0].value as number : config.thresholds[i].value as number);\n });\n }\n\n private drawThresholdsPerBarInGroup(group: GroupType, config: PcacBarHorizontalChartConfig) {\n const self = this\n this.applyPreTransitionThresholdStyles(group.enter().append('rect'))\n .attr('data-group-threshold-id', (_: PcacData, i: number) => {\n return i;\n })\n .attr('height', this.yScaleGrouped.bandwidth())\n .on('mousemove', function (this: any, event: MouseEvent) {\n const target = event.target as Element\n const index = Number(target.getAttribute(\"data-group-threshold-id\"))\n const groupIndex = Number(this.parentElement.dataset['groupId'])\n // Parent is the data group (see drawThresholdsPerGroup), not the threshold entry itself.\n self.showTooltip(\n event,\n config.thresholds[groupIndex].data[index],\n { index, parent: config.data[groupIndex], parentIndex: groupIndex, isThreshold: true, valueFormat: self.xAxis.format }\n );\n })\n .transition()\n .duration(this.transitionService.getTransitionDuration())\n .attr('y', (d: PcacData) => {\n // ScaleBand can return undefined for a key outside its domain; `.attr()` needs null, not undefined.\n return this.yScaleGrouped(d.key as string) ?? null;\n })\n .attr('x', (d: PcacData, i: number, n: any) => {\n return this.xScale(config.thresholds[n[0].parentElement.dataset['groupId']].data[i].value as number);\n });\n }\n\n private applyPreTransitionThresholdStyles<S extends Selection<any, any, any, any>>(elm: S): S {\n return elm.attr('class', 'pcac-threshold')\n .style('fill', () => {\n return this.colorService.getAlert();\n })\n .style('stroke', () => {\n return this.colorService.getAlert();\n })\n .style('stroke-width', () => {\n return 2;\n })\n .attr('width', '3px')\n .on('mouseout', () => {\n this.hideTooltip();\n });\n }\n}\n","import { DestroyRef, ElementRef, Injectable, Signal, afterNextRender, inject } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { Subject } from 'rxjs';\nimport { debounceTime } from 'rxjs/operators';\n\n/**\n * Rebuilds a chart whenever its container's real, laid-out size changes.\n *\n * A plain `window:resize` listener (the previous approach) misses any layout-driven size change\n * that isn't a viewport resize — a sidebar collapsing, a tab becoming active, a flex/grid reflow.\n * It also can't help a chart that mounts already holding data (e.g. behind a loading gate): that\n * chart's first `ngOnChanges` can fire before the browser has committed layout for its own\n * just-created DOM node, so `PcacChart.initializeChartState()` measures a 0-width container and\n * bails out with nothing drawn — and with no resize ever firing, nothing retries it.\n *\n * `ResizeObserver`'s callback contract guarantees real, laid-out dimensions on every firing,\n * including its first, so observing the container naturally retries that exact case.\n */\n@Injectable({ providedIn: 'root' })\nexport class PcacChartResizeService {\n /**\n * Call once from a chart component's constructor (an injection context).\n * @param chartElm Signal resolving to the chart's `<svg>` element ref, e.g. a `viewChild.required` query.\n * @param rebuild Invoked whenever the chart's container size changes: immediately for the\n * observer's first (guaranteed-initial) callback, debounced for every one after that.\n */\n observe(chartElm: Signal<ElementRef>, rebuild: () => void): void {\n const destroyRef = inject(DestroyRef);\n const trigger$ = new Subject<void>();\n trigger$.pipe(\n debounceTime(300),\n takeUntilDestroyed(destroyRef)\n ).subscribe(rebuild);\n\n // chartElm() is a required viewChild query: unreadable until this component's own view has\n // been created, so we defer the observe() call itself rather than reading it eagerly here.\n afterNextRender(() => {\n const container = chartElm().nativeElement.parentNode as HTMLElement;\n // The observer's first callback is its guaranteed initial one (see the class doc comment) -\n // it's correcting an already-wrong first paint (e.g. a host layout, like a Material sidenav,\n // that hasn't finished settling its width yet when this chart's very first build ran), not\n // responding to live resize churn, so it shouldn't sit behind the same 300ms debounce meant\n // for that. Left debounced, that correction could land while the wrong-width build's own\n // enter transition is still visibly mid-animation, restarting it partway through - firing it\n // immediately instead means the correction lands within a frame or two, before there's\n // anything to visibly interrupt. Every callback after the first is still debounced normally.\n let firstCallback = true;\n const observer = new ResizeObserver(() => {\n if (firstCallback) {\n firstCallback = false;\n rebuild();\n return;\n }\n trigger$.next();\n });\n observer.observe(container);\n destroyRef.onDestroy(() => observer.disconnect());\n });\n }\n}\n","import { Directive, TemplateRef, inject } from '@angular/core';\nimport { PcacData } from './chart.model';\n\n/**\n * A datum drawn at the same coordinate as the hovered one (see `PcacTooltipContext.coincident`),\n * located the same way the context locates `$implicit`: `parent` is the series it belongs to,\n * `index` its position in `parent.data`, `parentIndex` the series' position in the chart's `data`.\n */\nexport interface PcacTooltipCoincident {\n data: PcacData;\n parent: PcacData;\n index: number;\n parentIndex: number;\n}\n\n/**\n * Template context handed to a consumer's `<ng-template pcacTooltip>` each time a tooltip is shown.\n */\nexport interface PcacTooltipContext {\n /**\n * The hovered datum: a bar, a line/area/plot point, a pie slice, or a threshold. Bound with a\n * bare `let-point` (or any name) in the template.\n */\n $implicit: PcacData;\n\n /**\n * The `PcacData` the hovered datum sits inside - the group a bar belongs to, or the series a\n * point belongs to. For a threshold, the data group it's drawn against (a threshold's own\n * `PcacData` usually carries only a value, so this is where its label lives). `null` when there\n * is no enclosing level (pie slices, a chart-wide threshold).\n */\n parent: PcacData | null;\n\n /**\n * True when the hovered element is a threshold marker on a bar chart rather than a data point.\n * In that case `$implicit` is the threshold's own `PcacData`.\n */\n isThreshold: boolean;\n\n /**\n * Position of `$implicit` in the array it was taken from: `parent.data` when there is a parent\n * (a bar within its group, a point within its series), or the chart's top-level `data` when\n * there isn't (a pie slice). For a threshold it's the position in `config.thresholds`, or in\n * `config.thresholds[parentIndex].data` for a per-bar threshold.\n *\n * Together with `parentIndex` this lets a template reach back into whatever collection the\n * `PcacData` was built from, as long as that collection is parallel to `data` (same order, no\n * filtering): `items[parentIndex][index]` for a two-level chart, `items[index]` for a pie.\n * Charts never reorder `data`, so the correspondence is stable across builds and resizes.\n */\n index: number;\n\n /**\n * Position of `parent` in the chart's top-level `data`; `null` whenever `parent` is.\n */\n parentIndex: number | null;\n\n /**\n * Every *other* datum drawn at exactly the same coordinate as `$implicit`, in data order, so a\n * template can list who else is at the hovered point. Set by the line, area and plot charts,\n * whether or not the plot chart's `pointFanOut` has spread the points apart (without it, the\n * hovered point is the only one of them visible, which makes this list all the more useful).\n * Empty on the other charts and whenever nothing shares the point.\n */\n coincident: PcacTooltipCoincident[];\n}\n\n/**\n * Marks an `<ng-template>` projected into any chart component as that chart's tooltip. When\n * present it replaces the default key/value tooltip *entirely* - the library only positions the\n * rendered template; it applies no background, padding or text styling of its own, so the template\n * owns the whole box.\n *\n * ```html\n * <pcac-bar-vertical-chart [config]=\"config\">\n * <ng-template pcacTooltip let-point let-group=\"parent\">\n * <div class=\"my-tooltip\">{{ group?.key }} / {{ point.key }}: {{ point.value | number }}</div>\n * </ng-template>\n * </pcac-bar-vertical-chart>\n * ```\n *\n * The template is rendered with full Angular semantics (pipes, directives, components, DI from\n * the declaring component), so anything a normal template can do works here too. `index` and\n * `parentIndex` locate the hovered datum within `data`, so a template can pull extra fields from\n * the consumer's own source collection when that collection is parallel to `data`:\n *\n * ```html\n * <ng-template pcacTooltip let-point let-i=\"index\" let-g=\"parentIndex\">\n * <div class=\"my-tooltip\">{{ orders[g!][i].customer }}: {{ point.value | number }}</div>\n * </ng-template>\n * ```\n *\n * `coincident` lists the other points at the hovered coordinate, each located the same way:\n *\n * ```html\n * <ng-template pcacTooltip let-point let-others=\"coincident\">\n * <div class=\"my-tooltip\">\n * {{ point.key }}, {{ point.value }}\n * @for (other of others; track other.parentIndex) { <div>Also here: {{ other.parent.key }}</div> }\n * </div>\n * </ng-template>\n * ```\n */\n@Directive({\n selector: 'ng-template[pcacTooltip]'\n})\nexport class PcacTooltipDirective {\n readonly templateRef = inject<TemplateRef<PcacTooltipContext>>(TemplateRef);\n\n /**\n * Lets the template type-checker know the shape of `let-` variables declared on the\n * `<ng-template>`, so `point.value` etc. are checked against `PcacData` under strictTemplates.\n */\n static ngTemplateContextGuard(_dir: PcacTooltipDirective, _ctx: unknown): _ctx is PcacTooltipContext {\n return true;\n }\n}\n","import { Component, ElementRef, ViewEncapsulation, contentChild, effect, inject, viewChild, input } from '@angular/core';\nimport { outputFromObservable } from '@angular/core/rxjs-interop';\nimport { BarHorizontalChartBuilder } from './bar-horizontal-chart.builder';\nimport { PcacBarHorizontalChartConfig } from './bar-horizontal-chart.model';\nimport { PcacChartResizeService } from '../../core/resize.service';\nimport { PcacTooltipDirective } from '../../core/tooltip.directive';\n\n@Component({\n selector: 'pcac-bar-horizontal-chart',\n // While `config().heightFull` is on, the chart fills its container instead of using a fixed\n // height (see PcacChartConfig.heightFull). That only works if this host element itself has a\n // height to hand down, so the class stretches it to `height: 100%`; the styling lives in CSS\n // rather than being measured/set in JS so the browser resolves it as part of normal layout.\n host: { '[class.pcac-height-full]': 'config().heightFull' },\n templateUrl: './bar-horizontal-chart.component.html',\n styleUrl: './bar-horizontal-chart.component.scss',\n encapsulation: ViewEncapsulation.None,\n providers: [BarHorizontalChartBuilder]\n})\nexport class PcacBarHorizontalChartComponent {\n private chartBuilder = inject(BarHorizontalChartBuilder);\n\n readonly config = input.required<PcacBarHorizontalChartConfig>();\n readonly chartElm = viewChild.required<ElementRef>('chart');\n readonly barClicked = outputFromObservable(this.chartBuilder.barClicked$);\n\n /**\n * Optional consumer `<ng-template pcacTooltip>` projected into this element; replaces the\n * default tooltip when present (see PcacTooltipDirective).\n */\n readonly tooltipTemplate = contentChild(PcacTooltipDirective);\n\n constructor() {\n // Reacts to config() the same way ngOnChanges used to — reading it here (rather than a\n // lifecycle hook) is what makes this an effect: it tracks config() as its dependency and\n // reruns whenever a new value comes in, signal-input-changes-drive-behavior all the way down.\n effect(() => this.buildChart());\n\n // Handed over as a getter so the builder reads the query at hover time, not in the effect\n // above (see PcacChart.tooltipTemplate).\n this.chartBuilder.tooltipTemplate = () => this.tooltipTemplate()?.templateRef;\n\n inject(PcacChartResizeService).observe(this.chartElm, () => {\n // Skip the ResizeObserver's routine initial callback when it lands after the effect above\n // already built successfully at this same width — only a real size change (or a build\n // that never happened, e.g. the 0-width mount race) should trigger a rebuild here.\n if (this.chartBuilder.containerSizeChanged(this.chartElm())) {\n this.buildChart();\n }\n });\n }\n\n buildChart(): void {\n const config = this.config();\n if (config && config.data && config.data.length > 0) {\n this.chartBuilder.buildChart(this.chartElm(), config);\n }\n }\n}\n","<section class=\"pcac-bar-horizontal-chart\">\n <svg #chart></svg>\n</section>\n","import { PcacAxisChartConfig, PcacData } from '../../core/chart.model';\n\nexport class PcacBarHorizontalChartConfig extends PcacAxisChartConfig {\n isStacked: boolean = false;\n thresholds: PcacData[] = [];\n spreadColorsPerGroup: boolean = false\n colorOverride: PcacBarHorizontalChartColorOverrideConfig = new PcacBarHorizontalChartColorOverrideConfig()\n}\n\nexport class PcacBarHorizontalChartColorOverrideConfig {\n colors: string[] = []\n}\n","import { Injectable, ElementRef } from '@angular/core';\n\nimport { select, Selection, BaseType } from 'd3-selection';\nimport { scaleBand, ScaleBand, scaleLinear, ScaleLinear } from 'd3-scale';\nimport { color } from 'd3-color';\n// Imported for its side effect only: this is what adds .transition() to d3-selection's\n// Selection prototype, which this builder leans on throughout.\nimport 'd3-transition';\n\n/**\n * Lib\n */\nimport { PcacBarVerticalChartConfig } from './bar-vertical-chart.model';\nimport { PcacChart } from '../../core/chart';\nimport { PcacData } from '../../core/chart.model';\nimport { stackStarts } from '../../core/stack';\n\nimport { Subject } from 'rxjs';\n\n// `BaseType` (not the hand-rolled union this used to be, which omitted `null` and never\n// actually matched what `.selectAll()`'s default generics resolve to).\ntype GroupType = Selection<BaseType, PcacData, BaseType, PcacData>;\n\n/**\n * Provided per-component (see PcacBarVerticalChartComponent's `providers`), not root-scoped:\n * this builder extends PcacChart, which holds mutable per-chart-instance state (margin, width,\n * height, colors, svg). A root singleton would be shared and clobbered by every\n * <pcac-bar-vertical-chart> rendered at once.\n */\n@Injectable()\nexport class BarVerticalChartBuilder extends PcacChart {\n private xScaleStacked!: ScaleBand<string>;\n private xScaleGrouped!: ScaleBand<string>;\n private yScale!: ScaleLinear<number, number>;\n private barClickedSource = new Subject<PcacData>();\n barClicked$ = this.barClickedSource.asObservable();\n\n\n\n buildChart(chartElm: ElementRef, config: PcacBarVerticalChartConfig): void {\n if (!config?.data?.length) {\n return;\n }\n\n // Shallow copy: initializeAxisState() rewrites `height` for hidden axes, and that must not\n // land on the consumer's own config object (it previously did, growing it by the margins on\n // first build).\n config = { ...config };\n this.initializeAxisState(config, 'y');\n if (!this.initializeChartState(chartElm, config)) {\n return;\n }\n\n // Copy before reversing: `.reverse()` is in place, and this is the consumer's own array -\n // reversing it directly flipped their palette on every rebuild (i.e. every resize).\n if (config.colorOverride && config.colorOverride.colors) {\n this.colors = [...config.colorOverride.colors].reverse();\n }\n this.buildScales(config);\n this.drawChart(chartElm, config);\n }\n\n private buildScales(config: PcacBarVerticalChartConfig) {\n // `this.height`, not `config.height`: with `heightFull` on they differ (see\n // PcacChart.resolveHeight), and the axis, grid and bar baselines all use the resolved one.\n // Bars grow from 0, so only `domainMax` is read; `yAxis.domainMin` is ignored.\n this.yScale = scaleLinear()\n .rangeRound([0, this.height])\n .domain([this.yAxis.domainMax as number, 0]);\n\n this.xScaleStacked = scaleBand()\n .domain(config.data.map((d) => d.key as string))\n .rangeRound([0, this.width])\n .padding(0.1);\n\n this.xScaleGrouped = scaleBand()\n .padding(0.2)\n .rangeRound([0, this.xScaleStacked.bandwidth()])\n .domain(config.data[0].data.map((d) => d.key as string));\n }\n\n private drawChart(chartElm: ElementRef, config: PcacBarVerticalChartConfig): void {\n this.buildContainer(chartElm);\n this.axisBuilder.drawAxis(this.axisBuilderConfig(this.xScaleStacked, this.yScale));\n this.drawGrids(this.xScaleStacked, this.yScale);\n this.addGroups(config);\n this.axisBuilder.raiseAxes(this.svg);\n }\n\n private addGroups(config: PcacBarVerticalChartConfig) {\n const groupsContainer = this.svg.append('g')\n .attr('class', 'pcac-bars')\n .selectAll('g')\n .data(config.data)\n .enter().append('g')\n .attr('class', 'pcac-bar-group')\n .attr('data-group-id', (d: PcacData, i: number) => {\n return i;\n })\n .attr('transform', (d: PcacData) => {\n return 'translate(' + this.xScaleStacked(d.key as string) + ',0)';\n });\n\n const group = groupsContainer.selectAll('rect')\n .data((d: PcacData) => {\n return d.data;\n });\n\n this.drawBarsPerGroup(group, config);\n\n // We have no thresholds to draw\n if (!config.thresholds) {\n return;\n }\n\n // Draw threshold across entire chart\n if (config.thresholds.length === 1 && !config.thresholds[0].data) {\n this.drawThresholdAcrossChart(config);\n }\n\n // Draw threshold across each group\n if (config.thresholds.length > 1 && (!config.thresholds[0].data || config.isStacked)) {\n this.drawThresholdsPerGroup(group, config);\n }\n\n // Draw threshold across each bar in group\n if (config.thresholds.length > 1 && config.thresholds[0].data && !config.isStacked) {\n this.drawThresholdsPerBarInGroup(group, config);\n }\n }\n\n private drawBarsPerGroup(group: GroupType, config: PcacBarVerticalChartConfig) {\n const self = this;\n // Stacked bars sit on top of the ones before them in their group; every other layout draws\n // from the baseline (start 0).\n const starts = config.isStacked ? stackStarts(config.data) : new Map<PcacData, number>();\n const startOf = (d: PcacData) => starts.get(d) ?? 0;\n const endOf = (d: PcacData) => startOf(d) + Number(d.value ?? 0);\n group.enter().append('rect')\n .attr('class', 'pcac-bar')\n .attr('x', (d: PcacData) => {\n const value = !config.isStacked ? this.xScaleGrouped(d.key as string) : this.xScaleStacked(d.key as string)\n return value ? value : 0;\n })\n .attr('data-group-bar-id', (_: PcacData, i: number) => {\n return i;\n })\n .style('fill', (d: PcacData, i: number, n: any) => {\n if (config.spreadColorsPerGroup) {\n const groupIndex = parseInt(n[0].parentNode.getAttribute('data-group-id'), 10);\n return this.colors[groupIndex];\n }\n return this.colors[i];\n })\n .attr('y', () => {\n return this.height;\n })\n .attr('height', 0)\n .on('mouseover', function (this: any) {\n select(this)\n .transition()\n .duration(self.transitionService.getTransitionDuration() / 5)\n .style('fill', () => {\n if (config.spreadColorsPerGroup) {\n const groupIndex = parseInt(this.parentNode.getAttribute('data-group-id'), 10);\n const c = color(self.colors[groupIndex])\n const ct = c ? c.darker(1).toString() : self.colors[groupIndex]\n return ct\n }\n const groupIndex = parseInt(this.getAttribute('data-group-bar-id'), 10);\n const c = color(self.colors[groupIndex])\n const ct = c ? c.darker(1).toString() : self.colors[groupIndex]\n return ct\n });\n })\n .on('mousemove', function (this: SVGRectElement, event: MouseEvent, d: PcacData) {\n const groupIndex = Number((this.parentNode as Element).getAttribute('data-group-id'));\n const index = Number(this.getAttribute('data-group-bar-id'));\n self.showTooltip(event, d, { index, parent: config.data[groupIndex], parentIndex: groupIndex, valueFormat: self.yAxis.format });\n })\n .on('mouseout', function (this: any) {\n self.hideTooltip();\n select(this)\n .transition()\n .duration(self.transitionService.getTransitionDuration() / 5)\n .style('fill', () => {\n if (config.spreadColorsPerGroup) {\n const groupIndex = parseInt(this.parentNode.getAttribute('data-group-id'), 10);\n return self.colors[groupIndex];\n }\n const groupIndex = parseInt(this.getAttribute('data-group-bar-id'), 10);\n return self.colors[groupIndex];\n });\n })\n .on('click', (_, d: PcacData) => {\n this.barClickedSource.next(d);\n })\n .transition()\n .duration(this.transitionService.getTransitionDuration())\n // .transition(\n // transition().duration(this.transitionService.getTransitionDuration())\n // )\n .attr('width', !config.isStacked ? this.xScaleGrouped.bandwidth() : this.xScaleStacked.bandwidth())\n .attr('y', (d: PcacData) => {\n return this.yScale(endOf(d));\n })\n .attr('height', (d: PcacData) => {\n return this.yScale(startOf(d)) - this.yScale(endOf(d));\n });\n }\n\n private drawThresholdAcrossChart(config: PcacBarVerticalChartConfig) {\n this.applyPreTransitionThresholdStyles(this.svg.select('.pcac-bars').append('rect'))\n .attr('width', this.width)\n .attr('data-group-threshold-id', (_: unknown, i: number) => {\n return i;\n })\n .on('mousemove', (event: MouseEvent) => {\n this.showTooltip(event, config.thresholds[0], { index: 0, isThreshold: true, valueFormat: this.yAxis.format });\n })\n .transition()\n .duration(this.transitionService.getTransitionDuration())\n .attr('y', (_: unknown, i: number) => {\n return this.yScale(config.thresholds[i].value as number);\n });\n }\n\n private drawThresholdsPerGroup(group: GroupType, config: PcacBarVerticalChartConfig) {\n const self = this\n this.applyPreTransitionThresholdStyles(this.svg.selectAll('.pcac-bar-group').append('rect'))\n .attr('width', this.xScaleStacked.bandwidth())\n .attr('data-group-threshold-id', (_: unknown, i: number) => {\n return i;\n })\n .on('mousemove', function (this: any, event: MouseEvent) {\n const index = Number(this.parentElement.dataset['groupId'])\n const threshold = config.thresholds[index];\n // A threshold's own PcacData is typically just a value, so its parent is the *data* group\n // it's drawn against (which has the key) rather than the threshold entry it came from.\n self.showTooltip(\n event,\n config.isStacked ? threshold.data[0] : threshold,\n { index, parent: config.data[index], parentIndex: index, isThreshold: true, valueFormat: self.yAxis.format }\n );\n })\n .transition()\n .duration(this.transitionService.getTransitionDuration())\n .attr('y', (_: unknown, i: number) => {\n return this.yScale(config.isStacked ? config.thresholds[i].data[0].value as number : config.thresholds[i].value as number);\n });\n }\n\n private drawThresholdsPerBarInGroup(group: GroupType, config: PcacBarVerticalChartConfig) {\n const self = this\n this.applyPreTransitionThresholdStyles(group.enter().append('rect'))\n .attr('data-group-threshold-id', (_: PcacData, i: number) => {\n return i;\n })\n .on('mousemove', function (this: any, event: MouseEvent) {\n const target = event.target as Element\n const index = Number(target.getAttribute(\"data-group-threshold-id\"))\n const groupIndex = Number(this.parentElement.dataset['groupId'])\n // Parent is the data group (see drawThresholdsPerGroup), not the threshold entry itself.\n self.showTooltip(\n event,\n config.thresholds[groupIndex].data[index],\n { index, parent: config.data[groupIndex], parentIndex: groupIndex, isThreshold: true, valueFormat: self.yAxis.format }\n );\n })\n .attr('width', this.xScaleGrouped.bandwidth())\n .transition()\n .duration(this.transitionService.getTransitionDuration())\n .attr('y', (d: PcacData, i: number, n: any) => {\n return this.yScale(config.thresholds[n[0].parentElement.dataset['groupId']].data[i].value as number);\n });\n }\n\n private applyPreTransitionThresholdStyles<S extends Selection<any, any, any, any>>(elm: S): S {\n return elm.attr('class', 'pcac-threshold')\n .attr('x', (d: any) => {\n // Not every caller's selection has a per-item PcacData bound (the whole-chart threshold\n // rect has none), hence the defensive fallback rather than assuming `d` is always present.\n const datum = d as PcacData | undefined;\n // ScaleBand can return undefined for a key outside its domain; `.attr()` needs null, not undefined.\n return this.xScaleGrouped(datum ? datum.key as string : '') ?? null;\n })\n .attr('y', () => {\n return this.height;\n })\n .attr('height', 0)\n .style('fill', () => {\n return this.colorService.getAlert();\n })\n .style('stroke', () => {\n return this.colorService.getAlert();\n })\n .style('stroke-width', () => {\n return 2;\n })\n .on('mouseout', () => {\n this.hideTooltip();\n })\n .attr('height', () => {\n return '3px';\n });\n }\n}\n","import { Component, ElementRef, ViewEncapsulation, contentChild, effect, inject, viewChild, input } from '@angular/core';\nimport { outputFromObservable } from '@angular/core/rxjs-interop';\nimport { BarVerticalChartBuilder } from './bar-vertical-chart.builder';\nimport { PcacBarVerticalChartConfig } from './bar-vertical-chart.model';\nimport { PcacChartResizeService } from '../../core/resize.service';\nimport { PcacTooltipDirective } from '../../core/tooltip.directive';\n\n@Component({\n selector: 'pcac-bar-vertical-chart',\n // While `config().heightFull` is on, the chart fills its container instead of using a fixed\n // height (see PcacChartConfig.heightFull). That only works if this host element itself has a\n // height to hand down, so the class stretches it to `height: 100%`; the styling lives in CSS\n // rather than being measured/set in JS so the browser resolves it as part of normal layout.\n host: { '[class.pcac-height-full]': 'config().heightFull' },\n templateUrl: './bar-vertical-chart.component.html',\n styleUrl: './bar-vertical-chart.component.scss',\n encapsulation: ViewEncapsulation.None,\n providers: [BarVerticalChartBuilder]\n})\nexport class PcacBarVerticalChartComponent {\n private chartBuilder = inject(BarVerticalChartBuilder);\n\n readonly config = input.required<PcacBarVerticalChartConfig>();\n readonly chartElm = viewChild.required<ElementRef>('chart');\n readonly barClicked = outputFromObservable(this.chartBuilder.barClicked$);\n\n /**\n * Optional consumer `<ng-template pcacTooltip>` projected into this element; replaces the\n * default tooltip when present (see PcacTooltipDirective).\n */\n readonly tooltipTemplate = contentChild(PcacTooltipDirective);\n\n constructor() {\n // Reacts to config() the same way ngOnChanges used to — reading it here (rather than a\n // lifecycle hook) is what makes this an effect: it tracks config() as its dependency and\n // reruns whenever a new value comes in, signal-input-changes-drive-behavior all the way down.\n effect(() => this.buildChart());\n\n // Handed over as a getter so the builder reads the query at hover time, not in the effect\n // above (see PcacChart.tooltipTemplate).\n this.chartBuilder.tooltipTemplate = () => this.tooltipTemplate()?.templateRef;\n\n inject(PcacChartResizeService).observe(this.chartElm, () => {\n // Skip the ResizeObserver's routine initial callback when it lands after the effect above\n // already built successfully at this same width — only a real size change (or a build\n // that never happened, e.g. the 0-width mount race) should trigger a rebuild here.\n if (this.chartBuilder.containerSizeChanged(this.chartElm())) {\n this.buildChart();\n }\n });\n }\n\n buildChart(): void {\n const config = this.config();\n if (config && config.data && config.data.length > 0) {\n this.chartBuilder.buildChart(this.chartElm(), config);\n }\n }\n}\n","<section class=\"pcac-bar-vertical-chart\">\n <svg #chart></svg>\n</section>\n","import { PcacAxisChartConfig, PcacData } from '../../core/chart.model';\n\nexport class PcacBarVerticalChartConfig extends PcacAxisChartConfig {\n isStacked: boolean = false;\n thresholds: PcacData[] = [];\n spreadColorsPerGroup: boolean = false\n colorOverride: PcacBarVerticalChartColorOverrideConfig = new PcacBarVerticalChartColorOverrideConfig()\n}\n\nexport class PcacBarVerticalChartColorOverrideConfig {\n colors: string[] = []\n}\n","import { Component, computed, inject, model, output } from '@angular/core';\nimport { PcacColorService } from '../core';\n\nexport class PcacLegendConfigItem {\n label!: string;\n checked: boolean = true;\n colorOverride: string | null = null;\n}\n\nexport class PcacLegendConfig {\n heading: string | null = null;\n items: PcacLegendConfigItem[] = [];\n}\n\n@Component({\n selector: 'pcac-legend',\n templateUrl: './legend.component.html',\n styleUrl: './legend.component.scss',\n})\nexport class PcacLegend {\n readonly colorService = inject(PcacColorService);\n config = model.required<PcacLegendConfig>();\n itemClicked = output<PcacLegendConfigItem[]>();\n\n colorScale = computed(() => \n this.colorService.getColorScale(this.config().items.length)\n );\n\n onItemClicked(index: number) {\n const items = this.config().items.map((item, i) =>\n i === index ? { ...item, checked: !item.checked } : item\n );\n this.config.set({ ...this.config(), items });\n this.itemClicked.emit(items);\n }\n}\n","<div class=\"pcac-legend-label\"><small>{{config().heading}}</small></div>\n@for(item of config().items; track $index; let i = $index; let last = $last;) {\n<div class=\"pcac-legend-item\" [class.pcac-legend-item-last]=\"last\" [class.pcac-legend-unchecked]=\"!item.checked\"\n role=\"switch\" [attr.aria-checked]=\"item.checked\" tabindex=\"0\" (click)=\"onItemClicked(i)\"\n (keydown.enter)=\"onItemClicked(i)\" (keydown.space)=\"onItemClicked(i); $event.preventDefault()\">\n @let color = item.colorOverride ? item.colorOverride : colorScale()[i];\n <div class=\"pcac-legend-circle\" [style.backgroundColor]=\"color\"></div>\n <small>{{ item.label }}</small>\n</div>\n}\n","import { PcacAxisChartConfig } from '../core/chart.model';\n\nexport enum PcacLineAreaPlotChartConfigType {\n Line = 'line',\n Area = 'area',\n Plot = 'plot'\n}\n\n/**\n * Sizing for the images drawn in place of a point's dot (see `PcacData.image`). An image is\n * scaled uniformly (up or down) to fit inside a `maxWidth` x `maxHeight` box, preserving its\n * aspect ratio, and is centered on the data point exactly where the dot would have been.\n */\nexport class PcacPointImageConfig {\n maxWidth: number = 16\n maxHeight: number = 16\n}\n\n/**\n * The axes' `format` and `domainMin`/`domainMax` (`PcacAxisConfig`) do more here than on the bar\n * charts. `yAxis.domainMin`/`domainMax` are the y scale's domain (default 0..100). `xAxis.format`\n * decides how each point's `key` becomes an x position: `Decimal` reads it as a number on a\n * linear scale from `xAxis.domainMin` to `domainMax`, `DateTime` parses it with `new Date()` on\n * a time scale between the two (both required), and every other format - including the default -\n * places points by their index within their series, sizing the axis from the first series'\n * length and ignoring the domain fields.\n */\nexport class PcacLineAreaChartConfig extends PcacAxisChartConfig {\n enableEffects: boolean = true\n /**\n * Zoom and pan along the x / y axis (scroll / pinch to zoom 1x-10x, drag to pan, never leaving\n * the original domain). Either, or both, can be on. A gesture is always two-dimensional, so with\n * only one enabled the other axis simply stays put. Both off by default.\n */\n enableZoomX: boolean = false\n enableZoomY: boolean = false\n\n /**\n * Hex color codes to override the default colors\n */\n colorOverride: string[] = []\n\n /**\n * Bounding box for any point images (`PcacData.image`) on this chart. Optional; each field falls\n * back to the `PcacPointImageConfig` default when not given, so a consumer only setting `image`\n * on their data still gets a sensibly-sized result.\n */\n pointImage?: Partial<PcacPointImageConfig>\n}\n","import { Selection, BaseType } from 'd3-selection';\nimport { ScaleLinear } from 'd3-scale';\nimport { PcacData } from '../../../core';\nimport { Injectable } from '@angular/core';\nimport { select } from 'd3-selection';\nimport { ScaleTime } from 'd3';\n\nexport interface IPlaChartEffectsBuilderConfig {\n colors: string[];\n data: PcacData[];\n width: number;\n height: number;\n svg: Selection<SVGGElement, unknown, BaseType, unknown>;\n x: ScaleLinear<number, number> | ScaleTime<number, number, never>;\n y: ScaleLinear<number, number> | ScaleTime<number, number, never>;\n}\n\n/**\n * Provided per-component (see PcacLineAreaChartComponent's `providers`), not root-scoped: this\n * holds mutable per-chart-instance state (`config`, `lines`) despite looking like a stateless\n * helper. A root singleton would be shared and clobbered by every `<pcac-line-area-chart>`\n * rendered at once — each instance's hover effects would end up reading/writing whichever\n * chart's `buildEffects()` ran last, not their own.\n */\n@Injectable()\nexport class PlaChartEffectsBuilder {\n private config!: IPlaChartEffectsBuilderConfig;\n // .getTotalLength()/.getPointAtLength() below are SVGGeometryElement methods - the paths this\n // collects are always <path> elements (see PlaChartBuilder.drawLine/.drawArea). A chart draws\n // one or the other depending on its `type` (never both), so this selector is never ambiguous.\n // Plot-type charts draw neither (just standalone dots, no connecting geometry) - updateEffects()\n // below guards against that rather than this collecting nothing for it to index into.\n private lines: SVGGeometryElement[] = [];\n\n buildEffects(config: IPlaChartEffectsBuilderConfig): void {\n this.config = config;\n this.lines = [];\n // Filtered on the same predicate buildCollection() applies to the effect groups (each path's\n // datum is its series' point array), so `lines[i]` always belongs to the i-th group - an\n // empty series in the middle of the data would otherwise shift every later group onto the\n // wrong path.\n this.config.svg.selectAll<SVGGeometryElement, PcacData[]>('.line, .area')\n .filter((d) => d?.length !== 0)\n .each((d, i, n) => {\n this.lines.push(n[i]);\n });\n this.buildCollection();\n this.buildCanvas();\n }\n\n /**\n * Swaps in the scales a zoom has rescaled. The crosshair finds its point by walking the line\n * geometry, which the chart already redraws on zoom, but the value it labels comes from\n * inverting `y` - so a y-axis zoom has to hand the zoomed scale over here or the label reads\n * the pixel against the original domain.\n */\n updateScales(x: IPlaChartEffectsBuilderConfig['x'], y: IPlaChartEffectsBuilderConfig['y']): void {\n this.config.x = x;\n this.config.y = y;\n }\n\n private buildCollection() {\n const collection = this.config.svg.append('g')\n .attr('class', 'effects');\n\n collection.append('path')\n .attr('class', 'effect-line');\n\n const mousePerLine = collection.selectAll('.effect-group')\n .data(this.config.data.filter((elm) => {\n return elm.data.length > 0;\n }))\n .enter().append('g')\n .attr('class', 'effect-group')\n .attr('style', (d: PcacData) => d.hide ? 'display: none' : null);\n\n mousePerLine.append('circle')\n .attr('r', 7)\n .attr('class', 'effect-circle')\n .style('stroke', (d: PcacData, i: number) => {\n return this.config.colors[i];\n });\n\n mousePerLine.append('text')\n .attr('class', 'effect-text')\n .attr('y', 1.5)\n .attr('transform', 'translate(10,3)');\n }\n\n private buildCanvas(): void {\n this.config.svg.append('rect')\n .attr('class', 'effects-canvas')\n .attr('width', this.config.width)\n .attr('height', this.config.height)\n .attr('pointer-events', 'all')\n .on('mouseout', () => {\n this.hideEffects();\n })\n .on('mouseover', () => {\n this.showEffects();\n })\n .on('mousemove', (event: MouseEvent) => {\n const current = event.currentTarget as Element\n const parent = current.parentElement\n const xForms = parent?.getAttribute('transform')\n if(!xForms) \n return this.onMouseMove([event.offsetX, event.offsetY]);\n \n const parts = /translate\\(\\s*([^\\s,)]+)[ ,]([^\\s,)]+)/.exec(xForms);\n if(!parts) \n return this.onMouseMove([event.offsetX, event.offsetY]);\n const x = Number(parts[1])\n this.onMouseMove([event.offsetX - x, event.offsetY]);\n });\n }\n\n private showEffects() {\n this.config.svg.select('.effect-line')\n .style('opacity', '1');\n this.config.svg.selectAll('.effect-group circle')\n .style('opacity', '1');\n this.config.svg.selectAll('.effect-group text')\n .style('opacity', '1');\n }\n\n private hideEffects() {\n this.config.svg.select('.effect-line')\n .style('opacity', '0');\n this.config.svg.selectAll('.effect-group circle')\n .style('opacity', '0');\n this.config.svg.selectAll('.effect-group text')\n .style('opacity', '0');\n }\n\n private onMouseMove(mousePos: [number, number]) {\n this.updateLine(mousePos);\n this.updateEffects(mousePos);\n }\n\n private updateLine(mousePos: [number, number]) {\n this.config.svg.select('.effect-line')\n .attr('d', () => 'M' + mousePos[0] + ',' + this.config.height + ' ' + mousePos[0] + ',' + 0);\n }\n\n private updateEffects(mousePos: [number, number]) {\n this.config.svg.selectAll('.effect-group')\n .attr('transform', (data, index: number, nodes) => {\n const line = this.lines[index];\n if (!line) {\n // No connected line/area geometry for this group to walk (a plot-type chart, whose\n // dots aren't joined by a path) — nothing to position the crosshair against, so leave\n // it where it was rather than reading .getTotalLength() off undefined.\n return null;\n }\n\n let beginning = 0;\n let end = line.getTotalLength();\n let pos;\n\n while (true) {\n const target = Math.floor((beginning + end) / 2);\n pos = line.getPointAtLength(target);\n if ((target === end || target === beginning) && pos.x !== mousePos[0]) {\n break;\n }\n\n if (pos.x > mousePos[0]) {\n end = target;\n } else if (pos.x < mousePos[0]) {\n beginning = target;\n } else {\n break;\n }\n }\n\n const textTarget = this.config.y.invert(pos.y) as number\n select(nodes[index]).select('text')\n .text(textTarget.toFixed(0));\n\n return 'translate(' + mousePos[0] + ',' + pos.y + ')';\n });\n }\n}\n","import { PcacLineAreaChartConfig } from \"../plot-line-area-chart.model\";\n\n/**\n * How the plot chart spreads out points that share a coordinate (see\n * `PcacPlotChartConfig.pointFanOut`). Each group of coincident points is placed evenly around\n * a ring centered on the shared coordinate, starting at 12 o'clock and going clockwise in data\n * order (series order, then point order), so every point stays visible and hoverable.\n */\nexport class PcacPointFanOutConfig {\n /**\n * Ring radius in px, the same for every group. When not set, each group gets the smallest\n * radius at which its neighbours sit `gap` px apart - so a pair barely moves while a group of\n * five spreads as far as it has to.\n */\n radius?: number\n\n /**\n * Space between neighbouring points on the ring, in px, when `radius` is not set. Measured\n * between their image boxes (or hovered dots), not their centers.\n */\n gap: number = 4\n\n /**\n * Draw a dot at the shared coordinate - the value the group's points actually have - with a\n * spoke out to each of them. Styled by the theme's `.fan-out-anchor` / `.fan-out-spoke` rules.\n */\n showAnchor: boolean = true\n}\n\nexport class PcacPlotChartConfig extends PcacLineAreaChartConfig {\n /**\n * Spread points that share a coordinate around it instead of drawing them on top of one\n * another (where only the last series' point shows, and only it can be hovered). Off when not\n * set; `{}` turns it on with every `PcacPointFanOutConfig` default. The fanned points keep\n * their true value in the tooltip, and the hovered point's tooltip context lists the others at\n * its coordinate in `coincident` (see `PcacTooltipContext`).\n *\n * Plot chart only: a line or area chart's points are joined in series order, so moving one\n * would kink the line.\n */\n pointFanOut?: Partial<PcacPointFanOutConfig>\n}\n","\nimport { scaleTime } from 'd3';\nimport { ScaleLinear, scaleLinear, ScaleTime } from 'd3-scale';\n\n\nimport { PcacData, PcacFormatEnum, PcacResolvedAxisConfig } from '../../../core/chart.model';\n\nexport class PlaChartScales {\n x!: ScaleLinear<number, number> | ScaleTime<number, number, never>;\n y!: ScaleLinear<number, number>;\n}\n\n/**\n * Takes the chart's *resolved* axes (`PcacChart.xAxis`/`yAxis`), not the raw config, so the\n * `format`/`domainMin`/`domainMax` defaults are already applied - see `PcacLineAreaChartConfig`\n * for what each format does with them.\n */\nexport class PlaChartScalesBuilder {\n build(\n xAxis: PcacResolvedAxisConfig, yAxis: PcacResolvedAxisConfig, data: PcacData[], chartWidth: number, chartHeight: number\n ): PlaChartScales {\n const resp = new PlaChartScales();\n resp.x = this.buildXScale(xAxis, data, chartWidth);\n resp.y = this.buildYScale(yAxis, chartHeight);\n return resp;\n }\n\n private buildXScale(\n xAxis: PcacResolvedAxisConfig, data: PcacData[], chartWidth: number\n ): ScaleLinear<number, number> | ScaleTime<number, number, never> {\n switch (xAxis.format) {\n case PcacFormatEnum.DateTime:\n return scaleTime()\n .domain([new Date(xAxis.domainMin), new Date(xAxis.domainMax)])\n .range([0, chartWidth]);\n case PcacFormatEnum.Decimal:\n return scaleLinear()\n .domain([xAxis.domainMin as number, xAxis.domainMax as number])\n .range([0, chartWidth]);\n default:\n // DatasetLength and every other format position points by index\n return scaleLinear()\n .domain([0, data[0].data.length - 1])\n .range([0, chartWidth]);\n }\n }\n\n private buildYScale(yAxis: PcacResolvedAxisConfig, chartHeight: number): ScaleLinear<number, number> {\n return scaleLinear()\n .domain([yAxis.domainMin as number, yAxis.domainMax as number])\n .range([chartHeight, 0]);\n }\n}\n","import { ScaleLinear, ScaleTime } from \"d3\";\nimport { PcacData, PcacFormatEnum } from \"../../core\";\n\nexport function getXFormat(type: PcacFormatEnum, data: PcacData, index: number, xScale: ScaleLinear<number, number> | ScaleTime<number, number, never>) {\n switch (type) {\n case PcacFormatEnum.DateTime:\n if (data.key) {\n return xScale(new Date(data.key));\n }\n return 0\n case PcacFormatEnum.Decimal:\n if (data.key) {\n return xScale(data.key as unknown as number);\n }\n return 0\n default:\n return xScale(index)\n }\n}","import { line, Line } from 'd3-shape';\nimport { getXFormat } from '../x-format';\nimport { PcacData, PcacFormatEnum } from '../../../core';\nimport { PlaChartScales } from './scales.builder';\n\nexport function buildLineGenerator(format: PcacFormatEnum, scales: PlaChartScales): Line<PcacData> {\n return line<PcacData>()\n .x((d: PcacData, i) => {\n return getXFormat(format, d, i, scales.x)\n })\n .y((d: PcacData) => {\n return scales.y(d.value as number);\n });\n}","import { Area, area } from 'd3-shape';\nimport { getXFormat } from '../x-format';\nimport { PcacData, PcacFormatEnum } from '../../../core';\nimport { PlaChartScales } from './scales.builder';\n\nexport function buildAreaGenerator(format: PcacFormatEnum, scales: PlaChartScales, chartHeight: number): Area<PcacData> {\n return area<PcacData>()\n .x((d: PcacData, i) => {\n return getXFormat(format, d, i, scales.x);\n })\n .y0(chartHeight)\n .y1((d: PcacData) => {\n return scales.y(d.value as number);\n });\n}","import { zoom } from \"d3\";\n\n/**\n * `extent` (the viewport the gesture happens in) is set to the plot area explicitly rather than\n * left to d3's default, which reads the *owning `<svg>`'s* size - plot plus margins. With the\n * viewport wider than `translateExtent`, d3's constraint centers the plot within it instead of\n * pinning the two together, so the first gesture (even one that zooms straight back out to k = 1)\n * left the chart shifted right/down by half the margins: x domain min detached from the y axis,\n * domain max pushed off the right edge.\n */\nexport function buildZoomBehavior(width: number, height: number, zoomedFn: (event: d3.D3ZoomEvent<Element, unknown>) => void): d3.ZoomBehavior<Element, unknown> {\n return zoom()\n .scaleExtent([1, 10])\n .extent([[0, 0], [width, height]])\n .translateExtent([[0, 0], [width, height]])\n .on(\"zoom\", zoomedFn);\n}\n","import { PcacData, PcacFormatEnum } from '../../../core/chart.model';\n\n/** A point along with where it sits in the chart's `data`, the way a tooltip context reports it. */\nexport interface PlaCoincidentPoint {\n data: PcacData;\n series: PcacData;\n /** Position of `data` within `series.data`. */\n index: number;\n /** Position of `series` within the chart's top-level `data`. */\n seriesIndex: number;\n}\n\n/** Two or more points that would be drawn at exactly the same coordinate, in data order. */\nexport interface PlaCoincidentGroup {\n members: PlaCoincidentPoint[];\n}\n\n/** How far a fanned-out point is drawn from its true coordinate, in px. */\nexport interface PlaPointOffset {\n dx: number;\n dy: number;\n}\n\n/**\n * Finds every set of points that share a coordinate across all of the chart's visible series.\n * Coincidence is decided from the data rather than from scaled pixels, so this can run before\n * the scales exist (the space the fan-out needs has to be reserved before the plot area, and so\n * the scales, is sized): two points coincide when they have the same y `value` and the same x\n * position under `xFormat` - the same numeric `key` (`Decimal`), the same instant (`DateTime`), or\n * the same index within their series (every other format, which positions by index). Mirrors\n * `getXFormat()`, which is what actually places them. Hidden series and points without a value\n * are left out, as they aren't drawn.\n */\nexport function findCoincidentGroups(series: PcacData[], xFormat: PcacFormatEnum): PlaCoincidentGroup[] {\n const byPosition = new Map<string, PlaCoincidentPoint[]>();\n series.forEach((s, seriesIndex) => {\n if (s.hide) {\n return;\n }\n s.data.forEach((data, index) => {\n if (data.value === null || data.value === undefined) {\n return;\n }\n const key = `${xPositionKey(xFormat, data, index)}|${data.value}`;\n let members = byPosition.get(key);\n if (!members) {\n members = [];\n byPosition.set(key, members);\n }\n members.push({ data, series: s, index, seriesIndex });\n });\n });\n return Array.from(byPosition.values())\n .filter((members) => members.length > 1)\n .map((members) => ({ members }));\n}\n\nfunction xPositionKey(xFormat: PcacFormatEnum, data: PcacData, index: number): string | number {\n switch (xFormat) {\n case PcacFormatEnum.DateTime:\n return data.key ? new Date(data.key).getTime() : 'none';\n case PcacFormatEnum.Decimal:\n return data.key ? Number(data.key) : 'none';\n default:\n return index;\n }\n}\n\n/**\n * The smallest ring radius at which `count` marks of `size` px sit `gap` px apart from their\n * neighbours: the chord between adjacent ring positions is `2r sin(π/n)`, so solve it for\n * `size + gap`. A pair (n = 2) lands `size + gap` apart along a diameter, as expected.\n */\nexport function fanOutRadius(count: number, size: number, gap: number): number {\n return (size + gap) / (2 * Math.sin(Math.PI / count));\n}\n\n/**\n * Places each group's members evenly around a ring centered on their shared coordinate, the\n * first member at 12 o'clock and the rest clockwise. `radius` is called per group so it can\n * depend on the group's size (see `fanOutRadius`). Keyed by the point objects themselves,\n * which are the very elements the builder binds to the DOM, so lookups are exact.\n */\nexport function fanOutOffsets(groups: PlaCoincidentGroup[], radius: (group: PlaCoincidentGroup) => number): Map<PcacData, PlaPointOffset> {\n const offsets = new Map<PcacData, PlaPointOffset>();\n for (const group of groups) {\n const r = radius(group);\n const n = group.members.length;\n group.members.forEach((member, i) => {\n const angle = -Math.PI / 2 + (i * 2 * Math.PI) / n;\n offsets.set(member.data, { dx: round(r * Math.cos(angle)), dy: round(r * Math.sin(angle)) });\n });\n }\n return offsets;\n}\n\n/** Two decimal places is plenty for an SVG coordinate and keeps `cos(π/2)` from reading as `6e-17`. */\nfunction round(value: number): number {\n return Math.round(value * 100) / 100;\n}\n","import { ElementRef, Injectable, inject } from '@angular/core';\nimport { select } from 'd3-selection';\nimport { Line, Area } from 'd3-shape';\nimport { range } from 'd3-array';\nimport { Subject } from 'rxjs';\n\n/**\n * Lib\n */\nimport { PlaChartEffectsBuilder } from './effects.builders';\nimport { PcacLineAreaChartConfig, PcacLineAreaPlotChartConfigType, PcacPointImageConfig } from '../../plot-line-area-chart.model';\nimport { PcacPlotChartConfig, PcacPointFanOutConfig } from '../../plot/plot.model';\nimport { PcacChart } from '../../../core/chart';\nimport { PcacData } from '../../../core/chart.model';\nimport { PcacTooltipCoincident } from '../../../core/tooltip.directive';\nimport { PlaChartScalesBuilder, PlaChartScales } from './scales.builder';\nimport { getXFormat } from '../x-format';\nimport { buildLineGenerator } from './line-generator.builder';\nimport { buildAreaGenerator } from './area-generator.builder';\nimport { buildZoomBehavior } from './zoom-behavior.builder';\nimport { PlaCoincidentGroup, PlaPointOffset, fanOutOffsets, fanOutRadius, findCoincidentGroups } from './fan-out.builder';\n\n/**\n * Provided per-component (see PcacLineAreaChartComponent's `providers`), not root-scoped: this\n * builder extends PcacChart, which holds mutable per-chart-instance state (margin, width,\n * height, colors, svg). A root singleton would be shared and clobbered by every\n * <pcac-line-area-chart> rendered at once.\n */\n@Injectable()\nexport class PlaChartBuilder extends PcacChart {\n private effectsBuilder = inject(PlaChartEffectsBuilder);\n private scales!: PlaChartScales;\n private lineGenerator!: Line<PcacData>;\n private areaGenerator!: Area<PcacData>;\n private zoomBehavior!: d3.ZoomBehavior<Element, unknown>;\n private dotClickedSource = new Subject<PcacData>();\n private config!: PcacLineAreaChartConfig;\n private clipPathId!: string; // <-- added\n /**\n * How far the clip-path rect extends past the drawable [0, width] x [0, height] area on every\n * side, so a point sitting exactly on the domain's edge isn't cut in half. 10px comfortably\n * clears a dot (r = 4, or 6 on hover); a point image can be much bigger than that, so\n * buildChart() widens this to half the largest image dimension whenever any point has one\n * (and grows the margins to match - see `reservePointImageSpace()` - since the clip-path only\n * matters up to the edge of the SVG).\n */\n private clipBuffer = 10;\n private pointImage!: PcacPointImageConfig;\n /**\n * Points that share a coordinate, found by `resolvePointLayout()`. `coincidentOf` looks a\n * point's group up for its tooltip; the rest only matter when `fanOut` is on (plot chart with\n * `pointFanOut`): `fanOutOffsets` is where each member is drawn relative to its true position,\n * and `fanOutReach` how far the farthest one sits from it, for the edge space to reserve.\n */\n private coincidentGroups: PlaCoincidentGroup[] = [];\n private coincidentOf = new Map<PcacData, PlaCoincidentGroup>();\n private fanOut: PcacPointFanOutConfig | null = null;\n private fanOutOffsets = new Map<PcacData, PlaPointOffset>();\n private fanOutReach = 0;\n dotClicked$ = this.dotClickedSource.asObservable();\n\n\n buildChart(chartElm: ElementRef, config: PcacLineAreaChartConfig, type: PcacLineAreaPlotChartConfigType): void {\n if (!config?.data?.length) {\n return;\n }\n\n this.config = JSON.parse(JSON.stringify(config));\n this.startData = range(this.config.data[0].data.length).map((): PcacData => ({\n key: '',\n value: 0,\n hide: false,\n data: []\n }));\n\n // A hidden axis keeps 8px rather than 0 so a dot on the edge of the plot isn't clipped\n this.initializeAxisState(this.config, 'y', 8);\n this.resolvePointLayout(type);\n this.reservePointSpace();\n\n if (!this.initializeChartState(chartElm, this.config)) {\n return;\n }\n // `?.length`, not a bare truthiness check: PcacLineAreaChartConfig defaults colorOverride to\n // `[]`, and an empty array is truthy - a config built with `new` would otherwise replace the\n // theme palette with nothing and every series would render with no color at all.\n if (this.config.colorOverride?.length) {\n this.colors = this.config.colorOverride;\n }\n\n this.scales = new PlaChartScalesBuilder().build(this.xAxis, this.yAxis, this.config.data, this.width, this.height);\n this.lineGenerator = buildLineGenerator(this.xAxis.format, this.scales);\n this.areaGenerator = buildAreaGenerator(this.xAxis.format, this.scales, this.height);\n\n if (this.zoomEnabled) {\n this.zoomBehavior = buildZoomBehavior(this.width, this.height, (event) => {\n // A d3 zoom transform is always two-dimensional; only the enabled axes follow it and the\n // other keeps its original scale, so that component of the gesture is simply ignored.\n const newX = this.config.enableZoomX ? event.transform.rescaleX(this.scales.x) : this.scales.x;\n const newY = this.config.enableZoomY ? event.transform.rescaleY(this.scales.y) : this.scales.y;\n const zoomedScales: PlaChartScales = { x: newX, y: newY };\n\n // Update the zoomed axes, each with its grid: the grid hangs off the axis's ticks, so it\n // is redrawn against the rescaled scale and dropped back underneath everything (append\n // puts it on top).\n if (this.config.enableZoomX) {\n this.axisBuilder.drawXAxis(this.axisBuilderConfig(newX, newY));\n this.svg.selectAll('.pcac-grid-vertical').remove();\n this.drawGrids(newX, newY, 'x');\n }\n if (this.config.enableZoomY) {\n this.axisBuilder.drawYAxis(this.axisBuilderConfig(newX, newY));\n this.svg.selectAll('.pcac-grid-horizontal').remove();\n this.drawGrids(newX, newY, 'y');\n }\n this.svg.selectAll('.pcac-grid').lower();\n\n // Update lines/areas. Fresh generators against the rescaled scales, so they go through\n // the same getXFormat() as the dots below - positioning by bare index here (which this\n // used to do, and which also overwrote the original generators' x accessor for good) is\n // only right for the default DatasetLength format; a DateTime/Decimal chart's lines\n // drifted away from its dots as soon as it was zoomed.\n const zoomedLine = buildLineGenerator(this.xAxis.format, zoomedScales);\n const zoomedArea = buildAreaGenerator(this.xAxis.format, zoomedScales, this.height);\n this.svg.selectAll<SVGPathElement, PcacData[]>('.line').attr('d', (d: PcacData[]) => zoomedLine(d));\n this.svg.selectAll<SVGPathElement, PcacData[]>('.area').attr('d', (d: PcacData[]) => zoomedArea(d));\n\n // Update dots / point images. Nested selectAll (not a flat svg.selectAll('.point')) so\n // that `i` is the point's index *within its own series* - the x format default\n // (DatasetLength) positions by index, and a flat selection would number every series'\n // points consecutively, shoving the second series' points off to the right on zoom.\n this.svg.selectAll('.dots').selectAll<SVGGElement, PcacData>('.point')\n .attr('transform', (d: PcacData, i: number) => this.pointTransform(d, i, zoomedScales));\n // A fan-out's anchor is positioned like the points it belongs to, so it moves the same way.\n this.svg.selectAll<SVGGElement, PlaCoincidentGroup>('.fan-out')\n .attr('transform', (g: PlaCoincidentGroup) => this.fanOutTransform(g, zoomedScales));\n\n // The hover crosshair walks the (already updated) line geometry, but reads its value back\n // off the y scale - which must be the zoomed one or the label is wrong.\n if (this.config.enableEffects) {\n this.effectsBuilder.updateScales(newX, newY);\n }\n\n // Redrawing an axis appends it at the end of the group, above the dots; put them back\n // on top so a point on the baseline isn't covered (see drawChart's draw order).\n this.svg.selectAll('.fan-outs').raise();\n this.svg.selectAll('.dots').raise();\n });\n }\n\n this.drawChart(chartElm, this.config, type);\n }\n\n private drawChart(chartElm: ElementRef, config: PcacLineAreaChartConfig, type: PcacLineAreaPlotChartConfigType): void {\n this.buildContainer(chartElm);\n this.attachZoomBehavior();\n this.createReusableClipPath(); \n\n this.axisBuilder.drawAxis(this.axisBuilderConfig(this.scales.x, this.scales.y));\n\n this.drawGrids(this.scales.x, this.scales.y);\n\n this.drawLineArea(config, type);\n\n if (config.enableEffects) {\n this.effectsBuilder.buildEffects({\n svg: this.svg,\n height: this.height,\n width: this.width,\n data: config.data,\n colors: this.colors,\n x: this.scales.x,\n y: this.scales.y\n });\n }\n\n // Axes above the lines/areas (so an axis line isn't covered by a series sitting at x = 0),\n // but the dots above the axes: a point on the baseline or the y axis stays whole. Fan-out\n // spokes go between the two so they run underneath the points they lead to.\n this.axisBuilder.raiseAxes(this.svg);\n this.drawFanOuts();\n this.drawDots(config);\n }\n\n /**\n * Resolves `pointImage`, finds the points that share a coordinate and, on a plot chart with\n * `pointFanOut`, works out where to draw each of them instead. Coincidence is found from the\n * data (see `findCoincidentGroups`) so this can run before the scales exist - it has to, as\n * `reservePointSpace()` needs the fan-out's reach before the plot area is sized. Line and area\n * charts still get the groups, for the tooltip's `coincident` list, but never an offset.\n */\n private resolvePointLayout(type: PcacLineAreaPlotChartConfigType): void {\n this.pointImage = { ...new PcacPointImageConfig(), ...this.config.pointImage };\n this.coincidentGroups = findCoincidentGroups(this.config.data, this.xAxis.format);\n this.coincidentOf = new Map(\n this.coincidentGroups.flatMap((group) => group.members.map((member) => [member.data, group] as const))\n );\n\n const fanOut = type === PcacLineAreaPlotChartConfigType.Plot\n ? (this.config as PcacPlotChartConfig).pointFanOut\n : undefined;\n if (!fanOut) {\n this.fanOut = null;\n this.fanOutOffsets = new Map();\n this.fanOutReach = 0;\n return;\n }\n this.fanOut = { ...new PcacPointFanOutConfig(), ...fanOut };\n // A group's members are kept apart by the size of what's drawn for them: the image box when\n // any member has an image, else a hovered dot (r = 6).\n const { maxWidth, maxHeight } = this.pointImage;\n const markSize = (group: PlaCoincidentGroup) =>\n group.members.some((member) => !!member.data.image) ? Math.max(maxWidth, maxHeight) : 12;\n const radius = (group: PlaCoincidentGroup) =>\n this.fanOut!.radius ?? fanOutRadius(group.members.length, markSize(group), this.fanOut!.gap);\n this.fanOutOffsets = fanOutOffsets(this.coincidentGroups, radius);\n this.fanOutReach = Math.ceil(Math.max(0, ...this.coincidentGroups.map(radius)));\n }\n\n /**\n * When any point has an `image`, or a fan-out has moved points off their coordinate, makes\n * room for them at the edge of the domain: the clip-path buffer grows to half the box (plus\n * the fan-out's reach) so the `.dots` group lets it through, and the margins grow to at least\n * that same amount so the `<svg>` doesn't cut off what the clip-path let through (an image box\n * is centered on its point, so at the top of the y domain half of it sits above the plot area\n * - in `margin.top`, which is only 8px by default). A fanned-out plain dot needs the same\n * treatment, its hovered radius plus the reach. Must run after `resolvePointLayout()` and\n * between `initializeAxisState()` and `initializeChartState()`, see `reserveEdgeSpace`.\n */\n private reservePointSpace(): void {\n const hasImages = this.config.data.some((series) => series.data.some((point) => !!point.image));\n if (!hasImages && this.fanOutReach === 0) {\n this.clipBuffer = 10;\n return;\n }\n const halfWidth = (hasImages ? Math.ceil(this.pointImage.maxWidth / 2) : 6) + this.fanOutReach;\n const halfHeight = (hasImages ? Math.ceil(this.pointImage.maxHeight / 2) : 6) + this.fanOutReach;\n this.clipBuffer = Math.max(10, halfWidth, halfHeight);\n this.reserveEdgeSpace({ top: halfHeight, bottom: halfHeight, left: halfWidth, right: halfWidth });\n }\n\n private createReusableClipPath(): void {\n this.clipPathId = `pcac-clip-${Date.now()}-${Math.floor(Math.random() * 10000)}`;\n this.svg.selectAll(`defs #${this.clipPathId}`).remove();\n this.svg.append('defs')\n .append('clipPath')\n .attr('id', this.clipPathId)\n .append('rect')\n // Extend the clip-path past the drawable area on every side so a dot (or point image) at\n // the x-domain's min/max, or the top/bottom of the y range, isn't cut in half. See clipBuffer.\n .attr('x', -this.clipBuffer)\n .attr('y', -this.clipBuffer)\n .attr('width', this.width + this.clipBuffer * 2)\n .attr('height', this.height + this.clipBuffer * 2);\n }\n\n private get zoomEnabled(): boolean {\n return !!(this.config.enableZoomX || this.config.enableZoomY);\n }\n\n private attachZoomBehavior(): void {\n if (!this.zoomEnabled) return;\n\n // Add a transparent rect to capture zoom events\n //\n // d3's `ZoomBehavior<Element, unknown>` vs. our concretely-typed `Selection<SVGRectElement|SVGGElement, ...>`\n // is a known D3+TS typings friction point: `.call()` structurally compares nested generic Selection\n // methods (`.merge()`, `.select()`, ...) and those never line up across two different concrete element\n // types, even though a zoom behavior works on any element at runtime. Narrow, local `any` escape hatch.\n this.svg.insert('rect', ':first-child')\n .attr('width', this.width)\n .attr('height', this.height)\n .attr('fill', 'none')\n .attr('pointer-events', 'all')\n .call(this.zoomBehavior as any)\n .transition()\n .duration(750)\n\n this.svg.call(this.zoomBehavior as any)\n .transition()\n .duration(750)\n }\n\n private drawLineArea(config: PcacLineAreaChartConfig, type: PcacLineAreaPlotChartConfigType): void {\n for (let i = 0; i < config.data.length; i++) {\n if (type === PcacLineAreaPlotChartConfigType.Area) {\n this.drawArea(config.data[i].data, i, config.data[i].hide);\n } else if (type === PcacLineAreaPlotChartConfigType.Line) {\n this.drawLine(config.data[i].data, i, config.data[i].hide);\n }\n }\n }\n\n private drawLine(lineData: PcacData[], index: number, hide = false): void {\n this.svg.append('g')\n .attr('class', 'lines')\n .attr('clip-path', `url(#${this.clipPathId})`) // <-- apply clip-path to line group\n .append('path')\n .datum(lineData)\n .attr('class', 'line')\n .attr('d', this.lineGenerator(this.startData))\n .transition()\n .duration(this.transitionService.getTransitionDuration())\n .attr('d', this.lineGenerator)\n .attr('stroke', () => {\n return this.colors[index];\n })\n .attr('fill', 'none')\n .attr('style', () => hide ? 'display: none' : null);\n }\n\n private drawArea(lineData: PcacData[], index: number, hide = false) {\n this.svg.append('g')\n .attr('class', 'areas')\n .attr('clip-path', `url(#${this.clipPathId})`) // <-- apply clip\n .append('path')\n .datum(lineData)\n .attr('class', 'area')\n // Same `hide` handling as drawLine()/drawDots(); the area used to ignore it and paint\n // a hidden series' fill anyway.\n .style('display', () => hide ? 'none' : null)\n .style('opacity', 0.5)\n .style('fill', () => {\n return this.colors[index];\n })\n .attr('d', this.areaGenerator(this.startData))\n .transition()\n .duration(this.transitionService.getTransitionDuration())\n .attr('d', this.areaGenerator);\n }\n\n /**\n * Draws one `<g class=\"fan-outs\">` holding a `<g class=\"fan-out\">` per group of coincident\n * points: a spoke from the shared coordinate to where each member is drawn, and an anchor dot\n * on the coordinate itself. Only when the fan-out is on and asks for anchors. The group is\n * positioned by the same translate as a point (see `drawDots`), so zoom moves it the same\n * way and everything inside is relative to the coordinate; it fades in over the points' own\n * entry transition.\n */\n private drawFanOuts(): void {\n if (!this.fanOut?.showAnchor || this.coincidentGroups.length === 0) {\n return;\n }\n const groups = this.svg.append('g')\n .attr('class', 'fan-outs')\n .attr('clip-path', `url(#${this.clipPathId})`)\n .selectAll('.fan-out')\n .data(this.coincidentGroups)\n .enter().append('g')\n .attr('class', 'fan-out')\n .attr('transform', (group: PlaCoincidentGroup) => this.fanOutTransform(group, this.scales));\n\n groups.selectAll('.fan-out-spoke')\n .data((group: PlaCoincidentGroup) => group.members.map((member) => this.offsetOf(member.data)))\n .enter().append('line')\n .attr('class', 'fan-out-spoke')\n .attr('x1', 0)\n .attr('y1', 0)\n .attr('x2', (spoke) => spoke.dx)\n .attr('y2', (spoke) => spoke.dy);\n\n groups.append('circle')\n .attr('class', 'fan-out-anchor')\n .attr('r', 3);\n\n groups.attr('opacity', 0)\n .transition()\n .duration(this.transitionService.getTransitionDuration())\n .attr('opacity', 1);\n }\n\n /**\n * Draws one `<g class=\"dots\">` per series holding a `<g class=\"point\">` per data point. The\n * point group carries the position (as a translate) so that zoom, on either axis, only has to\n * touch that one attribute regardless of what's inside; the child is either the regular\n * `<circle class=\"dot\">` or, when the point has a `PcacData.image`, an `<image class=\"dot-image\">`\n * in its place, and sits at the group's origin. Both animate in from the baseline the same way\n * - the start is the baseline expressed relative to the point, since the group is already on\n * the point - and the tooltip / click handlers sit on the group so they behave identically for\n * either. A fanned-out point's offset is applied to the child, inside the group, so it too is\n * untouched by zoom.\n */\n private drawDots(config: PcacLineAreaChartConfig): void {\n const self = this;\n const duration = this.transitionService.getTransitionDuration();\n const { maxWidth, maxHeight } = this.pointImage;\n const rise = (d: PcacData) => this.scales.y(0) - this.scales.y(d.value as number);\n\n for (let index = 0; index < config.data.length; index++) {\n const series = config.data[index];\n const points = this.svg.append('g')\n .attr('class', 'dots')\n .attr('clip-path', `url(#${this.clipPathId})`) // <-- apply clip\n .attr('style', series.hide ? 'display: none' : null)\n .selectAll('.point')\n .data(series.data)\n .enter().append('g')\n .attr('class', 'point')\n .attr('transform', (d: PcacData, i: number) => this.pointTransform(d, i, this.scales))\n .on('mouseover', function (this: SVGGElement, event: MouseEvent, d: PcacData) {\n // `d` is the very element bound from `series.data` above, so identity lookup is exact.\n self.showTooltip(event, d, {\n index: series.data.indexOf(d),\n parent: series,\n parentIndex: index,\n coincident: self.coincidentWith(d),\n valueFormat: self.yAxis.format,\n keyFormat: self.xAxis.format,\n });\n // No-op for an image point (no circle inside to grow).\n select(this).select('.dot')\n .transition()\n .duration(duration / 3)\n .attr('r', 6)\n .attr('fill', self.colors[index]);\n })\n .on('mouseout', function (this: SVGGElement) {\n self.hideTooltip();\n select(this).select('.dot')\n .transition()\n .duration(duration / 3)\n .attr('r', 4)\n .attr('fill', '#fff');\n })\n .on('click', (_event: MouseEvent, d: PcacData) => {\n this.dotClickedSource.next(d);\n });\n\n points.filter((d: PcacData) => !d.image)\n .append('circle')\n .attr('class', 'dot')\n .attr('stroke', this.colors[index])\n .attr('cx', (d: PcacData) => this.offsetOf(d).dx)\n .attr('cy', rise)\n .attr('fill', '#fff')\n .transition()\n .duration(duration)\n .attr('cy', (d: PcacData) => this.offsetOf(d).dy)\n .attr('r', 4);\n\n // `preserveAspectRatio=\"xMidYMid meet\"` is what does the \"resize to fit\" - the image is\n // scaled uniformly to fit inside the maxWidth x maxHeight box and centered within it, so\n // a non-square image still lands centered on the point. x/y offset by half the box so the\n // box (not its top-left corner) is centered on the point group's origin, matching where a\n // dot sits.\n points.filter((d: PcacData) => !!d.image)\n .append('image')\n .attr('class', 'dot-image')\n .attr('href', (d: PcacData) => d.image as string)\n .attr('width', maxWidth)\n .attr('height', maxHeight)\n .attr('preserveAspectRatio', 'xMidYMid meet')\n .attr('x', (d: PcacData) => -maxWidth / 2 + this.offsetOf(d).dx)\n .attr('y', (d: PcacData) => rise(d) - maxHeight / 2)\n .transition()\n .duration(duration)\n .attr('y', (d: PcacData) => -maxHeight / 2 + this.offsetOf(d).dy);\n }\n }\n\n private pointTransform(d: PcacData, i: number, scales: PlaChartScales): string {\n return `translate(${getXFormat(this.xAxis.format, d, i, scales.x)}, ${scales.y(d.value as number)})`;\n }\n\n /** A fan-out sits where its members would have been drawn; any member locates it. */\n private fanOutTransform(group: PlaCoincidentGroup, scales: PlaChartScales): string {\n const { data, index } = group.members[0];\n return this.pointTransform(data, index, scales);\n }\n\n private offsetOf(d: PcacData): PlaPointOffset {\n return this.fanOutOffsets.get(d) ?? { dx: 0, dy: 0 };\n }\n\n /** The other points at `d`'s coordinate, for the tooltip context (see `PcacTooltipContext.coincident`). */\n private coincidentWith(d: PcacData): PcacTooltipCoincident[] {\n const group = this.coincidentOf.get(d);\n if (!group) {\n return [];\n }\n return group.members\n .filter((member) => member.data !== d)\n .map((member) => ({ data: member.data, parent: member.series, index: member.index, parentIndex: member.seriesIndex }));\n }\n}\n","import { Component, ElementRef, TemplateRef, ViewEncapsulation, effect, inject, viewChild, input } from '@angular/core';\nimport { outputFromObservable } from '@angular/core/rxjs-interop';\n\nimport { PcacLineAreaChartConfig, PcacLineAreaPlotChartConfigType } from './plot-line-area-chart.model';\nimport { PlaChartBuilder } from './core/builders/chart.builder';\nimport { PlaChartEffectsBuilder } from './core/builders/effects.builders';\nimport { PcacChartResizeService } from '../core/resize.service';\nimport { PcacTooltipContext } from '../core/tooltip.directive';\n\n@Component({\n selector: 'pcac-line-area-chart',\n // While `config().heightFull` is on, the chart fills its container instead of using a fixed\n // height (see PcacChartConfig.heightFull). That only works if this host element itself has a\n // height to hand down, so the class stretches it to `height: 100%`; the styling lives in CSS\n // rather than being measured/set in JS so the browser resolves it as part of normal layout.\n host: { '[class.pcac-height-full]': 'config().heightFull' },\n templateUrl: './plot-line-area-chart.component.html',\n styleUrl: './plot-line-area-chart.component.scss',\n encapsulation: ViewEncapsulation.None,\n // PlaChartEffectsBuilder must be listed here too, not just PlaChartBuilder: it's injected\n // *inside* PlaChartBuilder, but its own per-instance state (see its class doc) still needs\n // this component's injector to shadow its (default) root scope, or every <pcac-line-area-chart>\n // on the page would share one PlaChartEffectsBuilder instance.\n providers: [PlaChartBuilder, PlaChartEffectsBuilder]\n})\nexport class PcacLineAreaChartComponent {\n private chartBuilder = inject(PlaChartBuilder);\n\n readonly config = input.required<PcacLineAreaChartConfig>();\n readonly type = input.required<PcacLineAreaPlotChartConfigType>();\n\n readonly chartElm = viewChild.required<ElementRef>('chart');\n readonly dotClicked = outputFromObservable(this.chartBuilder.dotClicked$);\n\n /**\n * The consumer's `<ng-template pcacTooltip>`, forwarded by the PcacLineChart/PcacAreaChart/\n * PcacPlotChart wrapper it was projected into. An input rather than a `contentChild()` query\n * of this component's own: content queries only see nodes declared directly inside the\n * element in the consumer's template, not ones the wrapper re-projects through `<ng-content>`,\n * so the wrapper has to run the query and pass the result down.\n */\n readonly tooltipTemplate = input<TemplateRef<PcacTooltipContext>>();\n\n constructor() {\n // Reacts to config()/type() the same way ngOnChanges used to — reading them here (rather\n // than a lifecycle hook) is what makes this an effect: it tracks whichever signals\n // buildChart() reads and reruns whenever either changes. That includes type(), which the old\n // ngOnChanges deliberately ignored (it only compared changes['config']) — in practice type()\n // is always bound to a constant per wrapper (PcacLineChart/PcacAreaChart/PcacPlotChart), so\n // this is unreachable today, but reacting to it is the more correct behavior regardless.\n effect(() => this.buildChart());\n\n // Handed over as a getter so the builder reads the input at hover time, not in the effect\n // above (see PcacChart.tooltipTemplate).\n this.chartBuilder.tooltipTemplate = () => this.tooltipTemplate();\n\n inject(PcacChartResizeService).observe(this.chartElm, () => {\n // Skip the ResizeObserver's routine initial callback when it lands after the effect above\n // already built successfully at this same width — only a real size change (or a build\n // that never happened, e.g. the 0-width mount race) should trigger a rebuild here.\n if (this.chartBuilder.containerSizeChanged(this.chartElm())) {\n this.buildChart();\n }\n });\n }\n\n buildChart(): void {\n const config = this.config();\n if (config && config.data && config.data.length > 0) {\n this.chartBuilder.buildChart(this.chartElm(), config, this.type());\n }\n }\n}\n","<section class=\"pcac-line-area-chart\">\n <svg #chart></svg>\n</section>\n\n","import { Component, contentChild, input, output } from \"@angular/core\";\nimport { PcacLineAreaChartComponent } from \"../plot-line-area-chart.component\";\nimport { PcacPlotChartConfig } from \"./plot.model\";\nimport { PcacLineAreaPlotChartConfigType } from \"../plot-line-area-chart.model\";\nimport { PcacData } from \"../../core\";\nimport { PcacTooltipDirective } from \"../../core/tooltip.directive\";\n\n@Component({\n selector: 'pcac-plot-chart',\n // Passes `heightFull` down the wrapper: the inner <pcac-line-area-chart> can only fill a host\n // that has a height itself (see PcacChartConfig.heightFull).\n host: { '[class.pcac-height-full]': 'config().heightFull' },\n templateUrl: './plot.component.html',\n imports: [PcacLineAreaChartComponent]\n})\nexport class PcacPlotChart {\n readonly config = input.required<PcacPlotChartConfig>();\n readonly types = PcacLineAreaPlotChartConfigType;\n readonly dotClicked = output<PcacData>();\n\n /**\n * Optional consumer `<ng-template pcacTooltip>` projected into this element, forwarded to the\n * inner chart (see PcacLineAreaChartComponent.tooltipTemplate for why it can't query it itself).\n */\n readonly tooltipTemplate = contentChild(PcacTooltipDirective);\n}\n","<pcac-line-area-chart [config]=\"config()\" [tooltipTemplate]=\"tooltipTemplate()?.templateRef\" [type]=\"types.Plot\" (dotClicked)=\"dotClicked.emit($event)\"/>","import { Component, contentChild, input, output } from \"@angular/core\";\nimport { PcacLineAreaChartComponent } from \"../plot-line-area-chart.component\";\nimport { PcacLineChartConfig } from \"./line.model\";\nimport { PcacLineAreaPlotChartConfigType } from \"../plot-line-area-chart.model\";\nimport { PcacData } from \"../../core\";\nimport { PcacTooltipDirective } from \"../../core/tooltip.directive\";\n\n@Component({\n selector: 'pcac-line-chart',\n // Passes `heightFull` down the wrapper: the inner <pcac-line-area-chart> can only fill a host\n // that has a height itself (see PcacChartConfig.heightFull).\n host: { '[class.pcac-height-full]': 'config().heightFull' },\n templateUrl: \"./line.component.html\",\n imports: [PcacLineAreaChartComponent]\n})\nexport class PcacLineChart {\n readonly config = input.required<PcacLineChartConfig>();\n readonly types = PcacLineAreaPlotChartConfigType;\n readonly dotClicked = output<PcacData>()\n\n /**\n * Optional consumer `<ng-template pcacTooltip>` projected into this element, forwarded to the\n * inner chart (see PcacLineAreaChartComponent.tooltipTemplate for why it can't query it itself).\n */\n readonly tooltipTemplate = contentChild(PcacTooltipDirective);\n}\n","<pcac-line-area-chart [config]=\"config()\" [tooltipTemplate]=\"tooltipTemplate()?.templateRef\" [type]=\"types.Line\" (dotClicked)=\"dotClicked.emit($event)\" />","import { PcacLineAreaChartConfig } from \"../plot-line-area-chart.model\";\n\nexport class PcacLineChartConfig extends PcacLineAreaChartConfig {\n\n}","import { Component, contentChild, input, output } from \"@angular/core\";\nimport { PcacAreaChartConfig } from \"./area.model\";\nimport { PcacLineAreaChartComponent } from \"../plot-line-area-chart.component\";\nimport { PcacLineAreaPlotChartConfigType } from \"../plot-line-area-chart.model\";\nimport { PcacData } from \"../../core\";\nimport { PcacTooltipDirective } from \"../../core/tooltip.directive\";\n\n@Component({\n selector: 'pcac-area-chart',\n // Passes `heightFull` down the wrapper: the inner <pcac-line-area-chart> can only fill a host\n // that has a height itself (see PcacChartConfig.heightFull).\n host: { '[class.pcac-height-full]': 'config().heightFull' },\n templateUrl: './area.component.html',\n imports: [PcacLineAreaChartComponent]\n})\nexport class PcacAreaChart {\n readonly config = input.required<PcacAreaChartConfig>();\n readonly types = PcacLineAreaPlotChartConfigType;\n readonly dotClicked = output<PcacData>()\n\n /**\n * Optional consumer `<ng-template pcacTooltip>` projected into this element, forwarded to the\n * inner chart (see PcacLineAreaChartComponent.tooltipTemplate for why it can't query it itself).\n */\n readonly tooltipTemplate = contentChild(PcacTooltipDirective);\n}\n","<pcac-line-area-chart [config]=\"config()\" [tooltipTemplate]=\"tooltipTemplate()?.templateRef\" [type]=\"types.Area\" (dotClicked)=\"dotClicked.emit($event)\" />","import { PcacLineAreaChartConfig } from \"../plot-line-area-chart.model\";\n\nexport class PcacAreaChartConfig extends PcacLineAreaChartConfig {\n\n}","// export * from './plot-line-area-chart.builder';\n// export * from './plot-line-area-chart.component';\n// export * from './plot-line-area-chart.model';\n// The rest of that model stays internal (the shared PcacLineAreaChartConfig is reached through\n// the per-chart PcacLineChartConfig/PcacAreaChartConfig/PcacPlotChartConfig subclasses), but\n// the point-image sizing type is part of those configs' public shape, so it's exported alone.\nexport { PcacPointImageConfig } from './plot-line-area-chart.model';\nexport * from './plot/plot.component';\nexport * from './plot/plot.model';\nexport * from './line/line.component';\nexport * from './line/line.model';\nexport * from './area/area.component';\nexport * from './area/area.model';","import { Injectable, ElementRef } from '@angular/core';\n\n/**\n * D3\n */\nimport { arc, pie, Arc, Pie, PieArcDatum } from 'd3-shape';\nimport { select } from 'd3-selection';\nimport { interpolate } from 'd3-interpolate';\nimport { transition } from 'd3-transition';\nimport { color } from 'd3-color';\n\n/**\n * Lib\n */\nimport { PcacPieChartConfig } from './pie-chart.model';\nimport { PcacChart } from '../core/chart';\nimport { PcacData } from '../core/chart.model';\n\nimport { Subject } from 'rxjs';\n\n\n/**\n * Provided per-component (see PcacPieChartComponent's `providers`), not root-scoped:\n * this builder extends PcacChart, which holds mutable per-chart-instance state (margin, width,\n * height, colors, svg). A root singleton would be shared and clobbered by every\n * <pcac-pie-chart> rendered at once.\n */\n@Injectable()\nexport class PieChartBuilder extends PcacChart {\n private radius!: number;\n private arcShape!: Arc<any, PieArcDatum<PcacData>>;\n private arcOverShape!: Arc<any, PieArcDatum<PcacData>>;\n private pieAngles!: Pie<any, PcacData>;\n private sliceClickedSource = new Subject<PcacData>();\n sliceClicked$ = this.sliceClickedSource.asObservable();\n\n buildChart(chartElm: ElementRef, config: PcacPieChartConfig): void {\n if (!config?.data?.length) {\n return;\n }\n\n // The pie deliberately opts out of `heightFull`: `height` here feeds the radius rather than a\n // drawing area, so growing into a tall container would silently change the size of the pie\n // itself. `PcacPieChartConfig` inherits the property from PcacChartConfig, so it's neutralized\n // here rather than being absent from the type. (`<pcac-pie-chart>` also never gets the\n // `pcac-height-full` class the other charts use to stretch their host.)\n if (!this.initializeChartState(chartElm, { ...config, heightFull: false })) {\n return;\n }\n this.radius = Math.min(Math.min(this.height, this.width), Math.min(this.height, this.width)) / 2;\n this.buildShapes();\n this.drawChart(chartElm, config);\n }\n\n private buildShapes(): void {\n const radiusOffset = 10;\n\n this.arcShape = arc<any, PieArcDatum<PcacData>>()\n .innerRadius(0)\n .outerRadius(this.radius - radiusOffset);\n\n this.arcOverShape = arc<any, PieArcDatum<PcacData>>()\n .innerRadius(0)\n .outerRadius(this.radius - radiusOffset + radiusOffset);\n\n this.pieAngles = pie<PcacData>()\n .sort(null)\n .value((d: PcacData) => d.value as number);\n }\n\n private drawChart(chartElm: ElementRef, config: PcacPieChartConfig): void {\n this.buildContainer(chartElm, true);\n const self = this;\n this.svg.selectAll('.pcac-arc')\n .data(this.pieAngles(config.data))\n .enter().append('g')\n .attr('class', 'pcac-arc')\n .append('path')\n .style('fill', (d: PieArcDatum<PcacData>, i: number) => {\n return this.colors[i];\n })\n .on('mouseover', function (this: SVGPathElement, _: MouseEvent, d: PieArcDatum<PcacData>) {\n const t = transition().duration(self.transitionService.getTransitionDuration() / 3)\n const c = color(self.colors[d.index])\n const ct = c ? c.darker(1).toString() : self.colors[d.index]\n select<SVGPathElement, PieArcDatum<PcacData>>(this).transition(t)\n .attr('d', self.arcOverShape)\n .style('fill', ct);\n })\n .on('mousemove', (event: MouseEvent, d: PieArcDatum<PcacData>) => {\n self.showTooltip(event, d.data, { index: d.index });\n })\n .on('mouseout', function (this: SVGPathElement, _: MouseEvent, d: PieArcDatum<PcacData>) {\n self.hideTooltip();\n select<SVGPathElement, PieArcDatum<PcacData>>(this)\n .transition()\n .duration(self.transitionService.getTransitionDuration() / 3)\n .attr('d', self.arcShape)\n .style('fill', self.colors[d.index]);\n })\n .on('click', (_event: MouseEvent, d: PieArcDatum<PcacData>) => {\n this.sliceClickedSource.next(d.data);\n })\n .transition()\n .duration(this.transitionService.getTransitionDuration())\n .attrTween('d', (b: PieArcDatum<PcacData>) => {\n return this.tweenChart(b);\n });\n }\n\n private tweenChart(b: PieArcDatum<PcacData>) {\n // `innerRadius`/`outerRadius` aren't part of PieArcDatum - arcShape's own .innerRadius()/.outerRadius()\n // accessors are fixed constants and never read them from the datum, so this is a legacy no-op kept for parity.\n (b as unknown as { innerRadius: number }).innerRadius = 0;\n const i = interpolate({ startAngle: 0, endAngle: 0 }, b);\n return (t: number) => this.arcShape(i(t)) ?? '';\n }\n}\n","import { Component, ElementRef, ViewEncapsulation, contentChild, effect, inject, viewChild, input } from '@angular/core';\nimport { outputFromObservable } from '@angular/core/rxjs-interop';\nimport { PcacPieChartConfig } from './pie-chart.model';\nimport { PieChartBuilder } from './pie-chart.builder';\nimport { PcacChartResizeService } from '../core/resize.service';\nimport { PcacTooltipDirective } from '../core/tooltip.directive';\n\n@Component({\n selector: 'pcac-pie-chart',\n templateUrl: './pie-chart.component.html',\n styleUrl: './pie-chart.component.scss',\n encapsulation: ViewEncapsulation.None,\n providers: [PieChartBuilder]\n})\nexport class PcacPieChartComponent {\n private chartBuilder = inject(PieChartBuilder);\n\n readonly config = input.required<PcacPieChartConfig>();\n readonly chartElm = viewChild.required<ElementRef>('chart');\n readonly sliceClicked = outputFromObservable(this.chartBuilder.sliceClicked$);\n\n /**\n * Optional consumer `<ng-template pcacTooltip>` projected into this element; replaces the\n * default tooltip when present (see PcacTooltipDirective).\n */\n readonly tooltipTemplate = contentChild(PcacTooltipDirective);\n\n constructor() {\n // Reacts to config() the same way ngOnChanges used to — reading it here (rather than a\n // lifecycle hook) is what makes this an effect: it tracks config() as its dependency and\n // reruns whenever a new value comes in, signal-input-changes-drive-behavior all the way down.\n effect(() => this.buildChart());\n\n // Handed over as a getter so the builder reads the query at hover time, not in the effect\n // above (see PcacChart.tooltipTemplate).\n this.chartBuilder.tooltipTemplate = () => this.tooltipTemplate()?.templateRef;\n\n inject(PcacChartResizeService).observe(this.chartElm, () => {\n // Skip the ResizeObserver's routine initial callback when it lands after the effect above\n // already built successfully at this same width — only a real size change (or a build\n // that never happened, e.g. the 0-width mount race) should trigger a rebuild here.\n if (this.chartBuilder.containerSizeChanged(this.chartElm())) {\n this.buildChart();\n }\n });\n }\n\n buildChart(): void {\n const config = this.config();\n if (config && config.data && config.data.length > 0) {\n this.chartBuilder.buildChart(this.chartElm(), config);\n }\n }\n}\n","<section class=\"pcac-pie-chart\">\n <svg #chart></svg>\n</section>\n\n","import { PcacChartConfig } from '../core/chart.model';\n\nexport class PcacPieChartConfig extends PcacChartConfig {\n}\n","/*\n * Public API Surface of pioneer-charts\n */\n\nexport * from './lib/bar-chart/bar-horizontal-chart/public-api';\nexport * from './lib/bar-chart/bar-vertical-chart/public-api';\nexport * from './lib/core/public-api';\nexport * from './lib/legend/public-api';\nexport * from './lib/plot-line-area-chart/public-api';\nexport * from './lib/pie-chart/public-api';\n\n","/**\n *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