@pioneer-code/pioneer-charts 22.2.7 → 22.2.10
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/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 *\n * The `*Color` fields each color one part of this axis, with any CSS color. Unset, the part keeps\n * the theme's color. A color never turns a part on - it only shows once the part is drawn. Each\n * is applied to the axis as the CSS custom property named on the field, so a stylesheet can set\n * the same property on any ancestor instead; a config value wins.\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 * Grid line color (`--pcac-grid-color`), shown while this axis's grid is drawn - see `showGrid`.\n * Theme default `$gray-200`.\n */\n gridColor?: string\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 * Tick mark color (`--pcac-axis-tick-color`), shown once `tickSize` has turned the marks on.\n * Theme default `$gray-900`.\n */\n tickColor?: string\n\n /**\n * Tick label color (`--pcac-axis-tick-label-color`) - the values along the axis. Default is the\n * page's text color (`currentColor`), as d3-axis has always drawn them.\n */\n tickLabelColor?: string\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 * Axis line color (`--pcac-axis-line-color`), shown with `showLine` on. Theme default `$gray-900`.\n */\n lineColor?: string\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 /** `label` color (`--pcac-axis-label-color`). Theme default `$gray-700`. */\n labelColor?: 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 /** `subLabels` color, all three (`--pcac-axis-sub-label-color`). Theme default `$gray-600`. */\n subLabelColor?: string\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`, `subLabels` and the `*Color` fields stay optional: \"not set\"\n * is itself the meaningful default (no marks, no labels, the theme's colors). The color fields\n * are picked up by name, so a new one needs only its declaration on the class.\n */\ntype PcacOptionalAxisFields = 'tickSize' | 'label' | 'subLabels' | Extract<keyof PcacAxisConfig, `${string}Color`>;\nexport type PcacResolvedAxisConfig = Required<Omit<PcacAxisConfig, PcacOptionalAxisFields>> & Pick<PcacAxisConfig, PcacOptionalAxisFields>;\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 // The optional fields (see `PcacOptionalAxisFields`) pass through as given; only the ones with\n // a default are spelled out.\n return {\n ...axis,\n hide: axis?.hide ?? defaults.hide!,\n showGrid: axis?.showGrid ?? showGridDefault,\n ticks: axis?.ticks ?? defaults.ticks!,\n showLine: axis?.showLine ?? defaults.showLine!,\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. The `*Color` fields are\n * applied by `applyColors`.\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 .call(applyColors, config.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(decimalTickFormat(config.xScale, config.xAxis.ticks));\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 .call(applyColors, config.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\n/**\n * Sets the axis's `*Color` fields on its group as CSS custom properties, which the theme reads\n * with its own color as the fallback (`var(--pcac-axis-tick-color, ...)`). Custom properties\n * rather than inline `stroke`/`fill` on the elements: the theme still decides what is drawn (a\n * color never un-hides marks or the line), the property reaches everything d3-axis draws in the\n * group, and a stylesheet can set the same property on any ancestor. An unset field sets nothing.\n */\nfunction applyColors(group: Selection<SVGGElement, unknown, BaseType, unknown>, axis: PcacResolvedAxisConfig): void {\n group\n .style('--pcac-axis-tick-color', () => axis.tickColor ?? null)\n .style('--pcac-axis-tick-label-color', () => axis.tickLabelColor ?? null)\n .style('--pcac-axis-line-color', () => axis.lineColor ?? null)\n .style('--pcac-axis-label-color', () => axis.labelColor ?? null)\n .style('--pcac-axis-sub-label-color', () => axis.subLabelColor ?? null);\n}\n\n/**\n * Tick labels for a `Decimal` axis: SI-prefixed (`1.5k`), with the precision taken from the\n * scale's own tick step rather than fixed. A fixed two significant digits (`.2s`) is fine for a\n * whole domain but breaks down once zoom narrows it to a few units - ticks at 10.5, 11, 11.5, 12\n * all rounded to `10 11 12 12`. `~` trims trailing zeros so a coarse step still reads `5 10 15`,\n * not `5.0 10.0 15.0`. Falls back to the fixed format for a scale without `tickFormat` (a\n * `Decimal` axis is always linear in practice, but the config type only promises `AxisScale`).\n */\nfunction decimalTickFormat<Domain extends AxisDomain>(scale: AxisScale<Domain>, ticks: number | undefined): (d: Domain) => string {\n const withTicks = scale as AxisScale<Domain> & { tickFormat?: (count?: number, specifier?: string) => (d: Domain) => string };\n const formatTick = withTicks.tickFormat ? withTicks.tickFormat(ticks, '~s') : (d: Domain) => format('.2s')(d as unknown as number);\n // The prefix comes from the domain's largest value, which would label the origin `0k`.\n return (d) => (Number(d) === 0 ? '0' : formatTick(d));\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 * Line color (`PcacAxisConfig.gridColor`), set on the grid group as `--pcac-grid-color` for the\n * theme's `.pcac-grid-rule line` rule to read; unset means the theme's color. See the axis\n * builder's `applyColors` for why a custom property.\n */\n color?: string;\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 .style('--pcac-grid-color', () => config.color ?? null)\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 .style('--pcac-grid-color', () => config.color ?? null)\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 palette = [] as string[];\n for (let i = 0; i < numberOfNodes; i++) {\n const mark = i % this.scale.length;\n palette.push(this.scale[mark]);\n }\n return palette;\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, color: this.xAxis.gridColor });\n }\n if (which !== 'x' && this.yAxis.showGrid) {\n this.gridBuilder.drawHorizontalGrid({ ...base, numberOfTicks: this.yAxis.ticks, color: this.yAxis.gridColor });\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. A ring at\n * the edge of the domain is moved back inside the plot area as one, so no member hangs over an\n * axis by more than half its mark - the same as a lone point there; the anchor stays put.\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 neighbors 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 neighboring 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 * whose colors `anchorColor` / `spokeColor` override.\n */\n showAnchor: boolean = true\n\n /**\n * Spoke color, any CSS color; theme default `$gray-400`. Applied as `--pcac-fan-out-spoke-color`\n * on the chart's `.fan-outs` group, so a stylesheet can set it on an ancestor instead (a config\n * value wins). Needs `showAnchor`.\n */\n spokeColor?: string\n\n /** Anchor dot color, likewise (`--pcac-fan-out-anchor-color`); theme default `$gray-600`. */\n anchorColor?: string\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\n/**\n * Whether a point has an x key to position by. An explicit emptiness check, not truthiness: a\n * Decimal key of `0` is a perfectly good coordinate (the left edge of a `domainMin: 0` axis) and\n * used to be read as \"no key\" - drawn at pixel 0 whatever the domain, and pinned there under zoom.\n */\nexport function hasKey(data: PcacData): boolean {\n return data.key !== null && data.key !== undefined && data.key !== '';\n}\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 (hasKey(data)) {\n return xScale(new Date(data.key as string | number));\n }\n return 0\n case PcacFormatEnum.Decimal:\n if (hasKey(data)) {\n return xScale(Number(data.key));\n }\n return 0\n default:\n return xScale(index)\n }\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';\nimport { hasKey } from '../x-format';\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 hasKey(data) ? new Date(data.key as string | number).getTime() : 'none';\n case PcacFormatEnum.Decimal:\n return hasKey(data) ? 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 * neighbors: 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\n/** A pixel position within the plot area, the way the scales report one. */\nexport interface PlaPoint {\n x: number;\n y: number;\n}\n\n/**\n * How far to move a whole fanned-out ring so that none of its members' centers leave the plot\n * area - so a member at the edge of the domain hangs over the axis by at most half its mark,\n * exactly as a lone point at that coordinate would, rather than by half its mark plus the ring's\n * radius. The ring moves as one (its members keep their spacing) and the anchor stays put, so the\n * spokes simply get longer on the side that was pushed back. Per axis: if the ring pokes out past\n * 0 it comes back by that much, else if it pokes out past the far edge it comes back by that; a\n * ring too big to fit is kept in at the axis end, where the origin is.\n *\n * `anchor` is clamped to the plot area first, so once zoom carries a group's coordinate out of the\n * domain its members follow it out at the same pace instead of staying pinned to the edge (or\n * snapping the ring's radius the moment the anchor crosses): at the edge the correction is exactly\n * the outermost member's offset, and stays so beyond it.\n */\nexport function fanOutShift(anchor: PlaPoint, offsets: PlaPointOffset[], plot: { width: number; height: number }): PlaPointOffset {\n const dxs = offsets.map((o) => o.dx);\n const dys = offsets.map((o) => o.dy);\n return {\n dx: axisShift(clamp(anchor.x, 0, plot.width), Math.min(...dxs), Math.max(...dxs), plot.width),\n dy: axisShift(clamp(anchor.y, 0, plot.height), Math.min(...dys), Math.max(...dys), plot.height),\n };\n}\n\nfunction axisShift(anchor: number, min: number, max: number, size: number): number {\n if (anchor + min < 0) {\n return round(-(anchor + min));\n }\n if (anchor + max > size) {\n return round(size - (anchor + max));\n }\n return 0;\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\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, PlaCoincidentPoint, PlaPoint, PlaPointOffset, fanOutOffsets, fanOutRadius, fanOutShift, 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/** Half the theme's 2px line stroke: how far the lines/areas/fan-outs clip-path reaches past the plot. */\nconst PLOT_CLIP_ALLOWANCE = 1;\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 * A second clip-path for everything that isn't a point - lines, areas, fan-out anchors and\n * spokes: the plot area plus `PLOT_CLIP_ALLOWANCE`. These have no business past the axes; the\n * points' buffer below used to apply to them too, so a line chart with big point images had\n * its lines run on half an image past the axes once zoomed.\n */\n private plotClipPathId!: string;\n /**\n * How far the points' clip-path rect extends past the drawable [0, width] x [0, height] area on\n * every side, so a point sitting exactly on the domain's edge isn't cut in half. 10px\n * comfortably clears a dot (r = 4, or 6 on hover); a point image can be much bigger than that,\n * so buildChart() widens this to half the largest image dimension whenever any point has one\n * (and grows the margins to match - see `reservePointSpace()` - since the clip-path only\n * matters up to the edge of the SVG). The buffer is only there for points whose center is\n * inside the plot; one whose center zoom has carried past an edge is hidden outright (see\n * `pointVisible`), rather than left showing up to a whole half-mark beyond the axis.\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 and for its ring's shift (see `fanOutShift`); `fanOutOffsets`\n * only matters when `fanOut` is on (plot chart with `pointFanOut`) and is where each member sits\n * on its ring relative to the shared coordinate, before that shift.\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 /** The `.point` group under the cursor, between its mouseover and mouseout (see `leavePoint`). */\n private hoveredPoint: SVGGElement | null = null;\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 // A rebuild throws the hovered point away with everything else, and a removed element gets\n // no mouseout, so its tooltip is closed here (see `leavePoint`).\n this.leavePoint();\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 // Zoom moves the points, not the mouse: the hovered one slides out from under a still\n // cursor (or is hidden outright, see `pointDisplay`), and either way the browser never\n // sends it a mouseout - its tooltip would stay up, and its dot stay grown, until the\n // cursor happened to cross it again. So the hover is ended here, on every zoom event.\n this.leavePoint();\n\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 .attr('display', (d: PcacData, i: number) => this.pointDisplay(d, i, zoomedScales));\n // A fan-out's anchor is positioned like the points it belongs to, so it moves the same way;\n // its spokes are re-aimed because the ring's shift back into the plot (`fanOutShift`)\n // depends on where the anchor now is.\n this.svg.selectAll<SVGGElement, PlaCoincidentGroup>('.fan-out')\n .attr('transform', (g: PlaCoincidentGroup) => this.fanOutTransform(g, zoomedScales))\n .selectAll<SVGLineElement, PlaCoincidentPoint>('.fan-out-spoke')\n .attr('x2', (member: PlaCoincidentPoint) => this.spokeEnd(member, zoomedScales).dx)\n .attr('y2', (member: PlaCoincidentPoint) => this.spokeEnd(member, zoomedScales).dy);\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. 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 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 }\n\n /**\n * When any point has an `image`, makes room for it at the edge of the domain: the clip-path\n * buffer grows to half the box so the `.dots` group lets it through, and the margins grow to at\n * least that same amount so the `<svg>` doesn't cut off what the clip-path let through (an image\n * box is centered on its point, so at the top of the y domain half of it sits above the plot\n * area - in `margin.top`, which is only 8px by default). Half the box is all a fan-out needs\n * too: a fanned-out ring is shifted back inside the plot area (`fanOutShift`), so no member's\n * center ever sits past the edge either. Must run after `resolvePointLayout()` and between\n * `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) {\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 const stamp = `${Date.now()}-${Math.floor(Math.random() * 10000)}`;\n this.clipPathId = `pcac-clip-${stamp}`;\n this.plotClipPathId = `pcac-clip-plot-${stamp}`;\n this.svg.selectAll(`defs #${this.clipPathId}, defs #${this.plotClipPathId}`).remove();\n const defs = this.svg.append('defs');\n defs.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 // Lines, areas and the fan-out anchors and spokes get the plot area itself, give or take a\n // stroke: a line along the domain's max keeps its full width rather than being halved at\n // the edge, but nothing runs on into the points' buffer - a spoke to a member that zoom has\n // carried out of the plot (and hidden, see `pointVisible`) stops at the axis.\n defs.append('clipPath')\n .attr('id', this.plotClipPathId)\n .append('rect')\n .attr('x', -PLOT_CLIP_ALLOWANCE)\n .attr('y', -PLOT_CLIP_ALLOWANCE)\n .attr('width', this.width + PLOT_CLIP_ALLOWANCE * 2)\n .attr('height', this.height + PLOT_CLIP_ALLOWANCE * 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 // A transparent rect so the empty plot area is a hit target too: a `<g>` has no area of its\n // own, so wheel/drag only reaches it through something painted. The rect is only ever that -\n // the behavior is attached once, to the group, and the rect's events bubble up to it. It used\n // to be `.call()`ed on both, and d3-zoom keeps its transform per element (`__zoom`): a wheel\n // over a point never passes through the rect (a sibling of the `.dots`, not an ancestor), so\n // only the group's transform advanced, and once the point had slid out from under the cursor\n // the next tick hit the rect - whose handler redrew from its own stale, near-identity\n // transform before the group's redrew from the real one, every tick, flickering the chart\n // between the two.\n //\n // d3's `ZoomBehavior<Element, unknown>` vs. our concretely-typed `Selection<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\n this.svg.call(this.zoomBehavior as any);\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.plotClipPathId})`)\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.plotClipPathId})`)\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 sits on\n * the true coordinate (unlike a point group, which also carries its ring's shift - see\n * `pointTransform`), so zoom moves it the same way and everything inside is relative to the\n * coordinate; each spoke ends where its member is actually drawn, ring offset plus shift. It\n * fades in over the points' own entry transition. `spokeColor` / `anchorColor` go on the outer\n * group as custom properties for the theme's `.fan-out-spoke` / `.fan-out-anchor` rules (see\n * the axis builder's `applyColors`).\n */\n private drawFanOuts(): void {\n if (!this.fanOut?.showAnchor || this.coincidentGroups.length === 0) {\n return;\n }\n const { spokeColor, anchorColor } = this.fanOut;\n const groups = this.svg.append('g')\n .attr('class', 'fan-outs')\n .attr('clip-path', `url(#${this.plotClipPathId})`)\n .style('--pcac-fan-out-spoke-color', () => spokeColor ?? null)\n .style('--pcac-fan-out-anchor-color', () => anchorColor ?? null)\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)\n .enter().append('line')\n .attr('class', 'fan-out-spoke')\n .attr('x1', 0)\n .attr('y1', 0)\n .attr('x2', (member: PlaCoincidentPoint) => this.spokeEnd(member, this.scales).dx)\n .attr('y2', (member: PlaCoincidentPoint) => this.spokeEnd(member, this.scales).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 ring offset is applied to the child, inside the group, so it too\n * is untouched by zoom; only its ring's shift back into the plot area, which depends on where\n * the coordinate is, rides along in the group's translate (see `pointTransform`).\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 .attr('display', (d: PcacData, i: number) => this.pointDisplay(d, i, this.scales))\n .on('mouseover', function (this: SVGGElement, event: MouseEvent, d: PcacData) {\n self.hoveredPoint = this;\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', () => this.leavePoint())\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 /**\n * Ends the current hover, if there is one: hides the tooltip and shrinks the dot back. Shared by\n * the point's own mouseout and the zoom handler, which has to end a hover the browser won't\n * (the point moves, the cursor doesn't - see `buildChart`'s zoom callback).\n */\n private leavePoint(): void {\n if (!this.hoveredPoint) {\n return;\n }\n const point = this.hoveredPoint;\n this.hoveredPoint = null;\n this.hideTooltip();\n select(point).select('.dot')\n .transition()\n .duration(this.transitionService.getTransitionDuration() / 3)\n .attr('r', 4)\n .attr('fill', '#fff');\n }\n\n /**\n * Where a point's group goes: its true coordinate, plus - for a fanned-out point - however far\n * its ring had to be shifted to stay inside the plot area at these scales. The shift is on the\n * group rather than the child because it changes as zoom moves the coordinate (the ring offset,\n * on the child, doesn't), and this is the one attribute zoom already updates.\n */\n private pointTransform(d: PcacData, i: number, scales: PlaChartScales): string {\n const { x, y } = this.pointPlacement(d, i, scales);\n return `translate(${x}, ${y})`;\n }\n\n /**\n * The `display` of a point's group at these scales: shown while its center is inside the plot\n * area, `none` once zoom has carried it past an edge. Together with the clip-path's buffer this\n * is what bounds how far a mark may hang over an axis: a point on the edge is drawn whole, half\n * of it outside the plot, and that half is the most that ever shows - the alternative, letting\n * the clip-path's buffer do the work, showed a point up to a whole half-mark beyond the axis\n * with its center already outside. Also takes it out of hover's reach, as a hidden group\n * receives no pointer events.\n */\n private pointDisplay(d: PcacData, i: number, scales: PlaChartScales): string | null {\n return this.pointVisible(d, i, scales) ? null : 'none';\n }\n\n private pointVisible(d: PcacData, i: number, scales: PlaChartScales): boolean {\n const { x, y } = this.markCenter(d, i, scales);\n // A hair of slack, so a point on the domain's edge isn't lost to a rescaled scale landing on\n // -0.0000001 instead of 0.\n const slack = 0.5;\n return x >= -slack && x <= this.width + slack && y >= -slack && y <= this.height + slack;\n }\n\n /** Where the point's group is drawn: its coordinate plus its ring's shift, if it's fanned out. */\n private pointPlacement(d: PcacData, i: number, scales: PlaChartScales): PlaPoint {\n const { x, y } = this.pointPosition(d, i, scales);\n const shift = this.shiftOf(d, scales);\n return { x: x + shift.dx, y: y + shift.dy };\n }\n\n /** Where the mark itself is centered: the group's placement plus the ring offset on the child. */\n private markCenter(d: PcacData, i: number, scales: PlaChartScales): PlaPoint {\n const { x, y } = this.pointPlacement(d, i, scales);\n const offset = this.offsetOf(d);\n return { x: x + offset.dx, y: y + offset.dy };\n }\n\n /** A fan-out sits on its members' true coordinate, with no shift applied; any member locates it. */\n private fanOutTransform(group: PlaCoincidentGroup, scales: PlaChartScales): string {\n const { data, index } = group.members[0];\n const { x, y } = this.pointPosition(data, index, scales);\n return `translate(${x}, ${y})`;\n }\n\n private pointPosition(d: PcacData, i: number, scales: PlaChartScales): PlaPoint {\n return { x: getXFormat(this.xAxis.format, d, i, scales.x), y: scales.y(d.value as number) };\n }\n\n /** A member's ring offset from the shared coordinate, `0` for a point that isn't fanned out. */\n private offsetOf(d: PcacData): PlaPointOffset {\n return this.fanOutOffsets.get(d) ?? { dx: 0, dy: 0 };\n }\n\n /** How far `d`'s ring is moved back into the plot area at these scales (see `fanOutShift`). */\n private shiftOf(d: PcacData, scales: PlaChartScales): PlaPointOffset {\n const group = this.coincidentOf.get(d);\n if (!group || !this.fanOutOffsets.has(d)) {\n return { dx: 0, dy: 0 };\n }\n const { data, index } = group.members[0];\n const offsets = group.members.map((member) => this.offsetOf(member.data));\n return fanOutShift(this.pointPosition(data, index, scales), offsets, { width: this.width, height: this.height });\n }\n\n /** Where a spoke ends, relative to its anchor: where the member is drawn, ring offset plus shift. */\n private spokeEnd(member: PlaCoincidentPoint, scales: PlaChartScales): PlaPointOffset {\n const offset = this.offsetOf(member.data);\n const shift = this.shiftOf(member.data, scales);\n return { dx: offset.dx + shift.dx, dy: offset.dy + shift.dy };\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 * 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;;;;;;;;;;;;AAYG;MACU,cAAc,CAAA;AACzB;;;;AAIG;IACH,IAAI,GAAa,KAAK;AAEtB;;;;;;;AAOG;AACH,IAAA,QAAQ;AAER;;;AAGG;AACH,IAA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A,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/point-range.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 *\n * The `*Color` fields each color one part of this axis, with any CSS color. Unset, the part keeps\n * the theme's color. A color never turns a part on - it only shows once the part is drawn. Each\n * is applied to the axis as the CSS custom property named on the field, so a stylesheet can set\n * the same property on any ancestor instead; a config value wins.\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 * Grid line color (`--pcac-grid-color`), shown while this axis's grid is drawn - see `showGrid`.\n * Theme default `$gray-200`.\n */\n gridColor?: string\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 * Tick mark color (`--pcac-axis-tick-color`), shown once `tickSize` has turned the marks on.\n * Theme default `$gray-900`.\n */\n tickColor?: string\n\n /**\n * Tick label color (`--pcac-axis-tick-label-color`) - the values along the axis. Default is the\n * page's text color (`currentColor`), as d3-axis has always drawn them.\n */\n tickLabelColor?: string\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 * Axis line color (`--pcac-axis-line-color`), shown with `showLine` on. Theme default `$gray-900`.\n */\n lineColor?: string\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 /** `label` color (`--pcac-axis-label-color`). Theme default `$gray-700`. */\n labelColor?: 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 /** `subLabels` color, all three (`--pcac-axis-sub-label-color`). Theme default `$gray-600`. */\n subLabelColor?: string\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`, `subLabels` and the `*Color` fields stay optional: \"not set\"\n * is itself the meaningful default (no marks, no labels, the theme's colors). The color fields\n * are picked up by name, so a new one needs only its declaration on the class.\n */\ntype PcacOptionalAxisFields = 'tickSize' | 'label' | 'subLabels' | Extract<keyof PcacAxisConfig, `${string}Color`>;\nexport type PcacResolvedAxisConfig = Required<Omit<PcacAxisConfig, PcacOptionalAxisFields>> & Pick<PcacAxisConfig, PcacOptionalAxisFields>;\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 // The optional fields (see `PcacOptionalAxisFields`) pass through as given; only the ones with\n // a default are spelled out.\n return {\n ...axis,\n hide: axis?.hide ?? defaults.hide!,\n showGrid: axis?.showGrid ?? showGridDefault,\n ticks: axis?.ticks ?? defaults.ticks!,\n showLine: axis?.showLine ?? defaults.showLine!,\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 /**\n * The span this point's `key` / `value` stands for, when the point is really the middle of a\n * range: `x` for the key, `y` for the value, either or both. Currently honored by the\n * line/area/plot charts only, on the innermost (point-level) `PcacData`, and only drawn when\n * the chart config turns `pointRange` on (see `PcacPointRangeConfig`). Nothing is labeled on\n * the chart; a custom tooltip can read it off the point.\n *\n * Optional for the same reason as `image`.\n */\n range?: PcacDataRange\n}\n\n/**\n * One side of a `PcacDataRange`. `min` above `max` is read as the other way round; `min` equal to\n * `max` (or either missing) as no range on that axis.\n */\nexport class PcacRangeBounds<T> {\n min!: T\n max!: T\n}\n\n/**\n * `PcacData.range`. `x` is read the way the point's `key` is, per the chart's `xAxis.format`: a\n * number for `Decimal`, anything `new Date()` accepts for `DateTime`, and for every index-based\n * format a (possibly fractional) index - `{ min: 2.5, max: 3.5 }` is half a slot either side of\n * the fourth point. `y` is on the value axis.\n */\nexport class PcacDataRange {\n x?: PcacRangeBounds<number | string>\n y?: PcacRangeBounds<number>\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. The `*Color` fields are\n * applied by `applyColors`.\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 .call(applyColors, config.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(decimalTickFormat(config.xScale, config.xAxis.ticks));\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 .call(applyColors, config.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\n/**\n * Sets the axis's `*Color` fields on its group as CSS custom properties, which the theme reads\n * with its own color as the fallback (`var(--pcac-axis-tick-color, ...)`). Custom properties\n * rather than inline `stroke`/`fill` on the elements: the theme still decides what is drawn (a\n * color never un-hides marks or the line), the property reaches everything d3-axis draws in the\n * group, and a stylesheet can set the same property on any ancestor. An unset field sets nothing.\n */\nfunction applyColors(group: Selection<SVGGElement, unknown, BaseType, unknown>, axis: PcacResolvedAxisConfig): void {\n group\n .style('--pcac-axis-tick-color', () => axis.tickColor ?? null)\n .style('--pcac-axis-tick-label-color', () => axis.tickLabelColor ?? null)\n .style('--pcac-axis-line-color', () => axis.lineColor ?? null)\n .style('--pcac-axis-label-color', () => axis.labelColor ?? null)\n .style('--pcac-axis-sub-label-color', () => axis.subLabelColor ?? null);\n}\n\n/**\n * Tick labels for a `Decimal` axis: SI-prefixed (`1.5k`), with the precision taken from the\n * scale's own tick step rather than fixed. A fixed two significant digits (`.2s`) is fine for a\n * whole domain but breaks down once zoom narrows it to a few units - ticks at 10.5, 11, 11.5, 12\n * all rounded to `10 11 12 12`. `~` trims trailing zeros so a coarse step still reads `5 10 15`,\n * not `5.0 10.0 15.0`. Falls back to the fixed format for a scale without `tickFormat` (a\n * `Decimal` axis is always linear in practice, but the config type only promises `AxisScale`).\n */\nfunction decimalTickFormat<Domain extends AxisDomain>(scale: AxisScale<Domain>, ticks: number | undefined): (d: Domain) => string {\n const withTicks = scale as AxisScale<Domain> & { tickFormat?: (count?: number, specifier?: string) => (d: Domain) => string };\n const formatTick = withTicks.tickFormat ? withTicks.tickFormat(ticks, '~s') : (d: Domain) => format('.2s')(d as unknown as number);\n // The prefix comes from the domain's largest value, which would label the origin `0k`.\n return (d) => (Number(d) === 0 ? '0' : formatTick(d));\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 * Line color (`PcacAxisConfig.gridColor`), set on the grid group as `--pcac-grid-color` for the\n * theme's `.pcac-grid-rule line` rule to read; unset means the theme's color. See the axis\n * builder's `applyColors` for why a custom property.\n */\n color?: string;\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 .style('--pcac-grid-color', () => config.color ?? null)\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 .style('--pcac-grid-color', () => config.color ?? null)\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 palette = [] as string[];\n for (let i = 0; i < numberOfNodes; i++) {\n const mark = i % this.scale.length;\n palette.push(this.scale[mark]);\n }\n return palette;\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, color: this.xAxis.gridColor });\n }\n if (which !== 'x' && this.yAxis.showGrid) {\n this.gridBuilder.drawHorizontalGrid({ ...base, numberOfTicks: this.yAxis.ticks, color: this.yAxis.gridColor });\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/** How a point's `range` is drawn (see `PcacPointRangeConfig.style`). */\nexport enum PcacPointRangeStyle {\n /** Error bars: a line across each range, capped at both ends. */\n Whiskers = 'whiskers',\n /** A rectangle spanning the x range by the y range; a thin strip when only one is set. */\n Box = 'box',\n /**\n * A fill strongest at the point's value and fading out to the range's edges: an oval glow\n * with both ranges (brightest on the value, even off-center), a fading bar with one.\n */\n Fade = 'fade'\n}\n\n/** When a point's `range` shows (see `PcacPointRangeConfig.show`). */\nexport enum PcacPointRangeShow {\n /** Only the hovered point's range. */\n Hover = 'hover',\n /** Every range at `faintOpacity`, the hovered point's at full strength. */\n Faint = 'faint',\n /** Every range at full strength; the others dim while a point is hovered. */\n Always = 'always'\n}\n\n/**\n * Drawing for `PcacData.range` on the line/area/plot charts. Ranges sit above the lines/areas and\n * below the points, on the point's true coordinate (a fanned-out point's range stays on its\n * anchor), clipped to the plot area and following zoom. The chart draws no numbers for them; a\n * custom tooltip gets the point, `range` included.\n */\nexport class PcacPointRangeConfig {\n style: PcacPointRangeStyle = PcacPointRangeStyle.Whiskers\n show: PcacPointRangeShow = PcacPointRangeShow.Faint\n\n /** Opacity of the ranges at rest under `show: Faint`, 0 - 1. */\n faintOpacity: number = 0.2\n\n /**\n * Any CSS color for every range on the chart. Unset, each takes its series' color. Applied as\n * `--pcac-point-range-color` on the chart's `.point-ranges` group, so a stylesheet can set it\n * on an ancestor instead (a config value wins).\n */\n color?: string\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 /**\n * Draw each point's `range` (see `PcacData.range`). Off when not set; `{}` turns it on with\n * every `PcacPointRangeConfig` default. Points without a `range` draw nothing extra.\n */\n pointRange?: Partial<PcacPointRangeConfig>\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. A ring at\n * the edge of the domain is moved back inside the plot area as one, so no member hangs over an\n * axis by more than half its mark - the same as a lone point there; the anchor stays put.\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 neighbors 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 neighboring 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 * whose colors `anchorColor` / `spokeColor` override.\n */\n showAnchor: boolean = true\n\n /**\n * Spoke color, any CSS color; theme default `$gray-400`. Applied as `--pcac-fan-out-spoke-color`\n * on the chart's `.fan-outs` group, so a stylesheet can set it on an ancestor instead (a config\n * value wins). Needs `showAnchor`.\n */\n spokeColor?: string\n\n /** Anchor dot color, likewise (`--pcac-fan-out-anchor-color`); theme default `$gray-600`. */\n anchorColor?: string\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\n/**\n * Whether a point has an x key to position by. An explicit emptiness check, not truthiness: a\n * Decimal key of `0` is a perfectly good coordinate (the left edge of a `domainMin: 0` axis) and\n * used to be read as \"no key\" - drawn at pixel 0 whatever the domain, and pinned there under zoom.\n */\nexport function hasKey(data: PcacData): boolean {\n return data.key !== null && data.key !== undefined && data.key !== '';\n}\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 (hasKey(data)) {\n return xScale(new Date(data.key as string | number));\n }\n return 0\n case PcacFormatEnum.Decimal:\n if (hasKey(data)) {\n return xScale(Number(data.key));\n }\n return 0\n default:\n return xScale(index)\n }\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 { BaseType, Selection } from 'd3-selection';\nimport { PcacData, PcacFormatEnum } from '../../../core/chart.model';\nimport { PcacPointRangeStyle } from '../../plot-line-area-chart.model';\nimport { PlaChartScales } from './scales.builder';\n\n/**\n * A point's `range` in pixels, alongside the point's own position. `x0 < x1` and `y0 < y1` (so\n * `y0` is the range's *max* - the y scale runs top-down); an axis without a usable range has\n * neither of its pair.\n */\nexport interface PlaRangeExtent {\n cx: number;\n cy: number;\n x0?: number;\n x1?: number;\n y0?: number;\n y1?: number;\n}\n\n/** Half the length of a whisker's end cap, in px. */\nexport const RANGE_CAP = 5;\n/** How thick a box is drawn along an axis the point has no range on, in px. */\nexport const RANGE_STRIP = 4;\n/** How thick a fade is drawn along an axis the point has no range on, in px. */\nexport const RANGE_FADE_BAR = 10;\n\n/**\n * Where an x range bound lands, read the way `getXFormat` reads a key: a date for `DateTime`, a\n * number for `Decimal`, and a (possibly fractional) index for every index-based format. `NaN`\n * for anything that doesn't parse.\n */\nfunction xBound(value: number | string, format: PcacFormatEnum, scales: PlaChartScales): number {\n if (value === null || value === undefined || value === '') {\n return NaN;\n }\n if (format === PcacFormatEnum.DateTime) {\n return scales.x(new Date(value)) as number;\n }\n return scales.x(Number(value)) as number;\n}\n\n/**\n * Sorts a pair of pixel bounds, or returns nothing if either isn't a real number - or if they're\n * the same, since a range that doesn't span anything has nothing to draw (whiskers would be a\n * stray pair of caps, a box or fade zero-sized).\n */\nfunction span(a: number, b: number): [number, number] | undefined {\n if (!Number.isFinite(a) || !Number.isFinite(b) || a === b) {\n return undefined;\n }\n return a <= b ? [a, b] : [b, a];\n}\n\n/**\n * `d`'s range at these scales, drawn around `(cx, cy)` - the point's true coordinate - or `null`\n * when it has no range on either axis that can be placed.\n */\nexport function rangeExtent(\n d: PcacData, cx: number, cy: number, format: PcacFormatEnum, scales: PlaChartScales\n): PlaRangeExtent | null {\n const range = d.range;\n if (!range) {\n return null;\n }\n const xs = range.x ? span(xBound(range.x.min, format, scales), xBound(range.x.max, format, scales)) : undefined;\n const ys = range.y ? span(scales.y(Number(range.y.min)), scales.y(Number(range.y.max))) : undefined;\n if (!xs && !ys) {\n return null;\n }\n const extent: PlaRangeExtent = { cx, cy };\n if (xs) {\n [extent.x0, extent.x1] = xs;\n }\n if (ys) {\n [extent.y0, extent.y1] = ys;\n }\n return extent;\n}\n\n/**\n * Where the point sits within its range's box, as 0 - 1 fractions: the fade's brightest spot.\n * An axis without a range has the point in the middle.\n */\nexport function rangeFocus(extent: PlaRangeExtent): { fx: number; fy: number } {\n const fraction = (v: number, lo?: number, hi?: number) =>\n lo === undefined || hi === undefined || hi === lo ? 0.5 : Math.min(1, Math.max(0, (v - lo) / (hi - lo)));\n return { fx: fraction(extent.cx, extent.x0, extent.x1), fy: fraction(extent.cy, extent.y0, extent.y1) };\n}\n\n/**\n * (Re)draws one point's range into `group`, in plot coordinates, replacing whatever was there -\n * the same call serves the first draw and every zoom. `gradientId` must be unique in the page;\n * only the fade uses it. Colors, stroke widths and opacity all come from the theme (see\n * plot-line-area-chart.component.scss), so nothing here depends on the series.\n */\nexport function drawRange(\n group: Selection<SVGGElement, unknown, BaseType, unknown>,\n extent: PlaRangeExtent,\n style: PcacPointRangeStyle,\n gradientId: string\n): void {\n group.selectAll('*').remove();\n const { cx, cy, x0, x1, y0, y1 } = extent;\n\n switch (style) {\n case PcacPointRangeStyle.Box: {\n const left = x0 ?? cx - RANGE_STRIP / 2;\n const right = x1 ?? cx + RANGE_STRIP / 2;\n const top = y0 ?? cy - RANGE_STRIP / 2;\n const bottom = y1 ?? cy + RANGE_STRIP / 2;\n group.append('rect')\n .attr('class', 'point-range-box')\n .attr('x', left)\n .attr('y', top)\n .attr('width', right - left)\n .attr('height', bottom - top)\n .attr('rx', 2);\n return;\n }\n\n case PcacPointRangeStyle.Fade: {\n const { fx, fy } = rangeFocus(extent);\n const stops = (gradient: Selection<any, unknown, BaseType, unknown>, offsets: [number, number][]) => {\n for (const [offset, opacity] of offsets) {\n gradient.append('stop')\n .attr('class', 'point-range-stop')\n .attr('offset', offset)\n .attr('stop-opacity', opacity);\n }\n };\n // The gradient lives inside the point's own group, not the chart's <defs>, so its stops\n // inherit the color custom properties set on the series group above it. Sized in\n // objectBoundingBox units, so the brightest spot stays on the point as zoom stretches it.\n const defs = group.append('defs');\n if (x0 !== undefined && x1 !== undefined && y0 !== undefined && y1 !== undefined) {\n const gradient = defs.append('radialGradient')\n .attr('id', gradientId)\n .attr('cx', 0.5).attr('cy', 0.5).attr('r', 0.5)\n .attr('fx', fx).attr('fy', fy);\n stops(gradient, [[0, 0.8], [0.5, 0.35], [1, 0]]);\n group.append('ellipse')\n .attr('class', 'point-range-fade')\n .attr('cx', (x0 + x1) / 2)\n .attr('cy', (y0 + y1) / 2)\n .attr('rx', (x1 - x0) / 2)\n .attr('ry', (y1 - y0) / 2)\n .attr('fill', `url(#${gradientId})`);\n return;\n }\n const vertical = y0 !== undefined && y1 !== undefined;\n const gradient = defs.append('linearGradient')\n .attr('id', gradientId)\n .attr('x1', 0).attr('y1', 0)\n .attr('x2', vertical ? 0 : 1).attr('y2', vertical ? 1 : 0);\n stops(gradient, [[0, 0.05], [vertical ? fy : fx, 0.8], [1, 0.05]]);\n const left = x0 ?? cx - RANGE_FADE_BAR / 2;\n const right = x1 ?? cx + RANGE_FADE_BAR / 2;\n const top = y0 ?? cy - RANGE_FADE_BAR / 2;\n const bottom = y1 ?? cy + RANGE_FADE_BAR / 2;\n group.append('rect')\n .attr('class', 'point-range-fade')\n .attr('x', left)\n .attr('y', top)\n .attr('width', right - left)\n .attr('height', bottom - top)\n .attr('rx', RANGE_FADE_BAR / 2)\n .attr('fill', `url(#${gradientId})`);\n return;\n }\n\n default: {\n // Whiskers\n const line = (xa: number, ya: number, xb: number, yb: number, cls: string) =>\n group.append('line')\n .attr('class', cls)\n .attr('x1', xa).attr('y1', ya)\n .attr('x2', xb).attr('y2', yb);\n if (y0 !== undefined && y1 !== undefined) {\n line(cx, y0, cx, y1, 'point-range-whisker');\n line(cx - RANGE_CAP, y0, cx + RANGE_CAP, y0, 'point-range-cap');\n line(cx - RANGE_CAP, y1, cx + RANGE_CAP, y1, 'point-range-cap');\n }\n if (x0 !== undefined && x1 !== undefined) {\n line(x0, cy, x1, cy, 'point-range-whisker');\n line(x0, cy - RANGE_CAP, x0, cy + RANGE_CAP, 'point-range-cap');\n line(x1, cy - RANGE_CAP, x1, cy + RANGE_CAP, 'point-range-cap');\n }\n }\n }\n}\n","import { PcacData, PcacFormatEnum } from '../../../core/chart.model';\nimport { hasKey } from '../x-format';\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 hasKey(data) ? new Date(data.key as string | number).getTime() : 'none';\n case PcacFormatEnum.Decimal:\n return hasKey(data) ? 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 * neighbors: 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\n/** A pixel position within the plot area, the way the scales report one. */\nexport interface PlaPoint {\n x: number;\n y: number;\n}\n\n/**\n * How far to move a whole fanned-out ring so that none of its members' centers leave the plot\n * area - so a member at the edge of the domain hangs over the axis by at most half its mark,\n * exactly as a lone point at that coordinate would, rather than by half its mark plus the ring's\n * radius. The ring moves as one (its members keep their spacing) and the anchor stays put, so the\n * spokes simply get longer on the side that was pushed back. Per axis: if the ring pokes out past\n * 0 it comes back by that much, else if it pokes out past the far edge it comes back by that; a\n * ring too big to fit is kept in at the axis end, where the origin is.\n *\n * `anchor` is clamped to the plot area first, so once zoom carries a group's coordinate out of the\n * domain its members follow it out at the same pace instead of staying pinned to the edge (or\n * snapping the ring's radius the moment the anchor crosses): at the edge the correction is exactly\n * the outermost member's offset, and stays so beyond it.\n */\nexport function fanOutShift(anchor: PlaPoint, offsets: PlaPointOffset[], plot: { width: number; height: number }): PlaPointOffset {\n const dxs = offsets.map((o) => o.dx);\n const dys = offsets.map((o) => o.dy);\n return {\n dx: axisShift(clamp(anchor.x, 0, plot.width), Math.min(...dxs), Math.max(...dxs), plot.width),\n dy: axisShift(clamp(anchor.y, 0, plot.height), Math.min(...dys), Math.max(...dys), plot.height),\n };\n}\n\nfunction axisShift(anchor: number, min: number, max: number, size: number): number {\n if (anchor + min < 0) {\n return round(-(anchor + min));\n }\n if (anchor + max > size) {\n return round(size - (anchor + max));\n }\n return 0;\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n","import { ElementRef, Injectable, inject } from '@angular/core';\nimport { select, Selection } 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, PcacPointRangeConfig } 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 { drawRange, rangeExtent } from './point-range.builder';\nimport { PlaCoincidentGroup, PlaCoincidentPoint, PlaPoint, PlaPointOffset, fanOutOffsets, fanOutRadius, fanOutShift, 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/** Half the theme's 2px line stroke: how far the lines/areas/fan-outs clip-path reaches past the plot. */\nconst PLOT_CLIP_ALLOWANCE = 1;\n\n/**\n * Names for the dot's transitions. d3 lets only one transition *per name* run on an element: a\n * new one cancels the old. The enter rise (`cy`) keeps the default name; the hover grow/shrink\n * and the entry's size-in (`r`) each get their own, so hovering a dot while the chart is still\n * animating in no longer cancels its rise and strands it short of its value. Hover interrupts\n * the size-in explicitly instead, since both tween `r`.\n */\nconst DOT_GROW_TRANSITION = 'pcac-dot-grow';\nconst DOT_HOVER_TRANSITION = 'pcac-dot-hover';\n/** See `revealAfterEntry`. */\nconst REVEAL_TRANSITION = 'pcac-reveal';\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 * A second clip-path for everything that isn't a point - lines, areas, fan-out anchors and\n * spokes: the plot area plus `PLOT_CLIP_ALLOWANCE`. These have no business past the axes; the\n * points' buffer below used to apply to them too, so a line chart with big point images had\n * its lines run on half an image past the axes once zoomed.\n */\n private plotClipPathId!: string;\n /**\n * How far the points' clip-path rect extends past the drawable [0, width] x [0, height] area on\n * every side, so a point sitting exactly on the domain's edge isn't cut in half. 10px\n * comfortably clears a dot (r = 4, or 6 on hover); a point image can be much bigger than that,\n * so buildChart() widens this to half the largest image dimension whenever any point has one\n * (and grows the margins to match - see `reservePointSpace()` - since the clip-path only\n * matters up to the edge of the SVG). The buffer is only there for points whose center is\n * inside the plot; one whose center zoom has carried past an edge is hidden outright (see\n * `pointVisible`), rather than left showing up to a whole half-mark beyond the axis.\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 and for its ring's shift (see `fanOutShift`); `fanOutOffsets`\n * only matters when `fanOut` is on (plot chart with `pointFanOut`) and is where each member sits\n * on its ring relative to the shared coordinate, before that shift.\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 /** The `.point` group under the cursor, between its mouseover and mouseout (see `leavePoint`). */\n private hoveredPoint: SVGGElement | null = null;\n /** `config.pointRange` with its defaults applied, or `null` while ranges are off. */\n private pointRange: PcacPointRangeConfig | null = null;\n /** Each drawn range's `.point-range` group, by its point, so hover can find the one to focus. */\n private rangeGroupOf = new Map<PcacData, SVGGElement>();\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 // A rebuild throws the hovered point away with everything else, and a removed element gets\n // no mouseout, so its tooltip is closed here (see `leavePoint`).\n this.leavePoint();\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 this.pointRange = this.config.pointRange ? { ...new PcacPointRangeConfig(), ...this.config.pointRange } : null;\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 // Zoom moves the points, not the mouse: the hovered one slides out from under a still\n // cursor (or is hidden outright, see `pointDisplay`), and either way the browser never\n // sends it a mouseout - its tooltip would stay up, and its dot stay grown, until the\n // cursor happened to cross it again. So the hover is ended here, on every zoom event.\n this.leavePoint();\n\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 .attr('display', (d: PcacData, i: number) => this.pointDisplay(d, i, zoomedScales));\n // A fan-out's anchor is positioned like the points it belongs to, so it moves the same way;\n // its spokes are re-aimed because the ring's shift back into the plot (`fanOutShift`)\n // depends on where the anchor now is.\n this.svg.selectAll<SVGGElement, PlaCoincidentGroup>('.fan-out')\n .attr('transform', (g: PlaCoincidentGroup) => this.fanOutTransform(g, zoomedScales))\n .selectAll<SVGLineElement, PlaCoincidentPoint>('.fan-out-spoke')\n .attr('x2', (member: PlaCoincidentPoint) => this.spokeEnd(member, zoomedScales).dx)\n .attr('y2', (member: PlaCoincidentPoint) => this.spokeEnd(member, zoomedScales).dy);\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 // Ranges are drawn in plot coordinates rather than hung off a translate, so every one is\n // redrawn against the zoomed scales.\n this.updatePointRanges(zoomedScales);\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('.point-ranges').raise();\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, and point\n // ranges under those.\n this.axisBuilder.raiseAxes(this.svg);\n this.drawPointRanges();\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. 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 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 }\n\n /**\n * When any point has an `image`, makes room for it at the edge of the domain: the clip-path\n * buffer grows to half the box so the `.dots` group lets it through, and the margins grow to at\n * least that same amount so the `<svg>` doesn't cut off what the clip-path let through (an image\n * box is centered on its point, so at the top of the y domain half of it sits above the plot\n * area - in `margin.top`, which is only 8px by default). Half the box is all a fan-out needs\n * too: a fanned-out ring is shifted back inside the plot area (`fanOutShift`), so no member's\n * center ever sits past the edge either. Must run after `resolvePointLayout()` and between\n * `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) {\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 const stamp = `${Date.now()}-${Math.floor(Math.random() * 10000)}`;\n this.clipPathId = `pcac-clip-${stamp}`;\n this.plotClipPathId = `pcac-clip-plot-${stamp}`;\n this.svg.selectAll(`defs #${this.clipPathId}, defs #${this.plotClipPathId}`).remove();\n const defs = this.svg.append('defs');\n defs.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 // Lines, areas and the fan-out anchors and spokes get the plot area itself, give or take a\n // stroke: a line along the domain's max keeps its full width rather than being halved at\n // the edge, but nothing runs on into the points' buffer - a spoke to a member that zoom has\n // carried out of the plot (and hidden, see `pointVisible`) stops at the axis.\n defs.append('clipPath')\n .attr('id', this.plotClipPathId)\n .append('rect')\n .attr('x', -PLOT_CLIP_ALLOWANCE)\n .attr('y', -PLOT_CLIP_ALLOWANCE)\n .attr('width', this.width + PLOT_CLIP_ALLOWANCE * 2)\n .attr('height', this.height + PLOT_CLIP_ALLOWANCE * 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 // A transparent rect so the empty plot area is a hit target too: a `<g>` has no area of its\n // own, so wheel/drag only reaches it through something painted. The rect is only ever that -\n // the behavior is attached once, to the group, and the rect's events bubble up to it. It used\n // to be `.call()`ed on both, and d3-zoom keeps its transform per element (`__zoom`): a wheel\n // over a point never passes through the rect (a sibling of the `.dots`, not an ancestor), so\n // only the group's transform advanced, and once the point had slid out from under the cursor\n // the next tick hit the rect - whose handler redrew from its own stale, near-identity\n // transform before the group's redrew from the real one, every tick, flickering the chart\n // between the two.\n //\n // d3's `ZoomBehavior<Element, unknown>` vs. our concretely-typed `Selection<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\n this.svg.call(this.zoomBehavior as any);\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.plotClipPathId})`)\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.plotClipPathId})`)\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=\"point-ranges\">` holding a group per series and, inside it, a\n * `<g class=\"point-range\">` per point that has a `range` - only while `pointRange` is on. Clipped\n * to the plot area and deaf to the pointer, so it never gets in the way of hover or zoom. When\n * each range shows is entirely the theme's business, driven by classes: `pcac-range-<show>` on\n * the outer group sets the resting opacity, and hover (`focusPointRange`) marks the hovered\n * point's range `is-focused` and the outer group `has-focus`. The colors are custom properties\n * - the series' own on its group, `color` (when set) on the outer one, which wins - see\n * plot-line-area-chart.component.scss.\n */\n private drawPointRanges(): void {\n this.rangeGroupOf = new Map();\n if (!this.pointRange) {\n return;\n }\n const { show, faintOpacity, color } = this.pointRange;\n const layer = this.svg.append('g')\n .attr('class', `point-ranges pcac-range-${show}`)\n .attr('clip-path', `url(#${this.plotClipPathId})`)\n .attr('pointer-events', 'none')\n .style('--pcac-point-range-color', () => color ?? null)\n .style('--pcac-point-range-faint-opacity', () => faintOpacity);\n\n this.config.data.forEach((series, seriesIndex) => {\n const seriesGroup = layer.append('g')\n .attr('class', 'point-range-series')\n .style('--pcac-point-range-series-color', () => this.colors[seriesIndex])\n .style('display', () => series.hide ? 'none' : null);\n series.data.forEach((point) => {\n if (point.range) {\n this.rangeGroupOf.set(point, seriesGroup.append('g').attr('class', 'point-range').node()!);\n }\n });\n });\n this.updatePointRanges(this.scales);\n this.revealAfterEntry(layer);\n }\n\n /**\n * Draws every range against `scales`, around its point's true coordinate - a fanned-out point's\n * range stays on the anchor, not on the ring. A range with nothing placeable is left empty.\n */\n private updatePointRanges(scales: PlaChartScales): void {\n if (!this.pointRange) {\n return;\n }\n const style = this.pointRange.style;\n this.config.data.forEach((series, seriesIndex) => {\n series.data.forEach((point, index) => {\n const node = this.rangeGroupOf.get(point);\n if (!node) {\n return;\n }\n const group = select(node);\n const { x, y } = this.pointPosition(point, index, scales);\n const extent = rangeExtent(point, x, y, this.xAxis.format, scales);\n if (!extent) {\n group.selectAll('*').remove();\n return;\n }\n drawRange(group, extent, style, `${this.plotClipPathId}-range-${seriesIndex}-${index}`);\n });\n });\n }\n\n /** Brings `d`'s range forward (see `drawPointRanges`), or with `null` puts every range back to rest. */\n private focusPointRange(d: PcacData | null): void {\n if (!this.pointRange || !this.svg) {\n return;\n }\n this.svg.selectAll('.point-range.is-focused').classed('is-focused', false);\n const node = d ? this.rangeGroupOf.get(d) : undefined;\n if (node) {\n select(node).classed('is-focused', true);\n }\n this.svg.select('.point-ranges').classed('has-focus', !!node);\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 sits on\n * the true coordinate (unlike a point group, which also carries its ring's shift - see\n * `pointTransform`), so zoom moves it the same way and everything inside is relative to the\n * coordinate; each spoke ends where its member is actually drawn, ring offset plus shift. It\n * fades in over the points' own entry transition. `spokeColor` / `anchorColor` go on the outer\n * group as custom properties for the theme's `.fan-out-spoke` / `.fan-out-anchor` rules (see\n * the axis builder's `applyColors`).\n */\n private drawFanOuts(): void {\n if (!this.fanOut?.showAnchor || this.coincidentGroups.length === 0) {\n return;\n }\n const { spokeColor, anchorColor } = this.fanOut;\n const groups = this.svg.append('g')\n .attr('class', 'fan-outs')\n .attr('clip-path', `url(#${this.plotClipPathId})`)\n .style('--pcac-fan-out-spoke-color', () => spokeColor ?? null)\n .style('--pcac-fan-out-anchor-color', () => anchorColor ?? null)\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)\n .enter().append('line')\n .attr('class', 'fan-out-spoke')\n .attr('x1', 0)\n .attr('y1', 0)\n .attr('x2', (member: PlaCoincidentPoint) => this.spokeEnd(member, this.scales).dx)\n .attr('y2', (member: PlaCoincidentPoint) => this.spokeEnd(member, this.scales).dy);\n\n groups.append('circle')\n .attr('class', 'fan-out-anchor')\n .attr('r', 3);\n\n this.revealAfterEntry(groups);\n }\n\n /**\n * Keeps `selection` hidden while the points rise in from the baseline, then fades it in. For\n * the guides drawn around the points (fan-out spokes and anchors, point ranges): they're drawn\n * where the points end up, so showing them during the rise has them pointing at empty space.\n * Its own transition name so that nothing else animating the same element cancels it.\n */\n private revealAfterEntry(selection: Selection<any, any, any, any>): void {\n const duration = this.transitionService.getTransitionDuration();\n selection.attr('opacity', 0)\n .transition(REVEAL_TRANSITION)\n .delay(duration)\n .duration(duration / 3)\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 ring offset is applied to the child, inside the group, so it too\n * is untouched by zoom; only its ring's shift back into the plot area, which depends on where\n * the coordinate is, rides along in the group's translate (see `pointTransform`).\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 .attr('display', (d: PcacData, i: number) => this.pointDisplay(d, i, this.scales))\n .on('mouseover', function (this: SVGGElement, event: MouseEvent, d: PcacData) {\n self.hoveredPoint = this;\n self.focusPointRange(d);\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). Its own transition name, so it\n // runs alongside the enter rise rather than cancelling it (see DOT_HOVER_TRANSITION);\n // it only takes over the entry's size tween, which it would otherwise fight over `r`.\n select(this).select('.dot')\n .interrupt(DOT_GROW_TRANSITION)\n .transition(DOT_HOVER_TRANSITION)\n .duration(duration / 3)\n .attr('r', 6)\n .attr('fill', self.colors[index]);\n })\n .on('mouseout', () => this.leavePoint())\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 .call((dots) => dots.transition()\n .duration(duration)\n .attr('cy', (d: PcacData) => this.offsetOf(d).dy))\n .transition(DOT_GROW_TRANSITION)\n .duration(duration)\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 /**\n * Ends the current hover, if there is one: hides the tooltip and shrinks the dot back. Shared by\n * the point's own mouseout and the zoom handler, which has to end a hover the browser won't\n * (the point moves, the cursor doesn't - see `buildChart`'s zoom callback).\n */\n private leavePoint(): void {\n if (!this.hoveredPoint) {\n return;\n }\n const point = this.hoveredPoint;\n this.hoveredPoint = null;\n this.hideTooltip();\n this.focusPointRange(null);\n select(point).select('.dot')\n .interrupt(DOT_GROW_TRANSITION)\n .transition(DOT_HOVER_TRANSITION)\n .duration(this.transitionService.getTransitionDuration() / 3)\n .attr('r', 4)\n .attr('fill', '#fff');\n }\n\n /**\n * Where a point's group goes: its true coordinate, plus - for a fanned-out point - however far\n * its ring had to be shifted to stay inside the plot area at these scales. The shift is on the\n * group rather than the child because it changes as zoom moves the coordinate (the ring offset,\n * on the child, doesn't), and this is the one attribute zoom already updates.\n */\n private pointTransform(d: PcacData, i: number, scales: PlaChartScales): string {\n const { x, y } = this.pointPlacement(d, i, scales);\n return `translate(${x}, ${y})`;\n }\n\n /**\n * The `display` of a point's group at these scales: shown while its center is inside the plot\n * area, `none` once zoom has carried it past an edge. Together with the clip-path's buffer this\n * is what bounds how far a mark may hang over an axis: a point on the edge is drawn whole, half\n * of it outside the plot, and that half is the most that ever shows - the alternative, letting\n * the clip-path's buffer do the work, showed a point up to a whole half-mark beyond the axis\n * with its center already outside. Also takes it out of hover's reach, as a hidden group\n * receives no pointer events.\n */\n private pointDisplay(d: PcacData, i: number, scales: PlaChartScales): string | null {\n return this.pointVisible(d, i, scales) ? null : 'none';\n }\n\n private pointVisible(d: PcacData, i: number, scales: PlaChartScales): boolean {\n const { x, y } = this.markCenter(d, i, scales);\n // A hair of slack, so a point on the domain's edge isn't lost to a rescaled scale landing on\n // -0.0000001 instead of 0.\n const slack = 0.5;\n return x >= -slack && x <= this.width + slack && y >= -slack && y <= this.height + slack;\n }\n\n /** Where the point's group is drawn: its coordinate plus its ring's shift, if it's fanned out. */\n private pointPlacement(d: PcacData, i: number, scales: PlaChartScales): PlaPoint {\n const { x, y } = this.pointPosition(d, i, scales);\n const shift = this.shiftOf(d, scales);\n return { x: x + shift.dx, y: y + shift.dy };\n }\n\n /** Where the mark itself is centered: the group's placement plus the ring offset on the child. */\n private markCenter(d: PcacData, i: number, scales: PlaChartScales): PlaPoint {\n const { x, y } = this.pointPlacement(d, i, scales);\n const offset = this.offsetOf(d);\n return { x: x + offset.dx, y: y + offset.dy };\n }\n\n /** A fan-out sits on its members' true coordinate, with no shift applied; any member locates it. */\n private fanOutTransform(group: PlaCoincidentGroup, scales: PlaChartScales): string {\n const { data, index } = group.members[0];\n const { x, y } = this.pointPosition(data, index, scales);\n return `translate(${x}, ${y})`;\n }\n\n private pointPosition(d: PcacData, i: number, scales: PlaChartScales): PlaPoint {\n return { x: getXFormat(this.xAxis.format, d, i, scales.x), y: scales.y(d.value as number) };\n }\n\n /** A member's ring offset from the shared coordinate, `0` for a point that isn't fanned out. */\n private offsetOf(d: PcacData): PlaPointOffset {\n return this.fanOutOffsets.get(d) ?? { dx: 0, dy: 0 };\n }\n\n /** How far `d`'s ring is moved back into the plot area at these scales (see `fanOutShift`). */\n private shiftOf(d: PcacData, scales: PlaChartScales): PlaPointOffset {\n const group = this.coincidentOf.get(d);\n if (!group || !this.fanOutOffsets.has(d)) {\n return { dx: 0, dy: 0 };\n }\n const { data, index } = group.members[0];\n const offsets = group.members.map((member) => this.offsetOf(member.data));\n return fanOutShift(this.pointPosition(data, index, scales), offsets, { width: this.width, height: this.height });\n }\n\n /** Where a spoke ends, relative to its anchor: where the member is drawn, ring offset plus shift. */\n private spokeEnd(member: PlaCoincidentPoint, scales: PlaChartScales): PlaPointOffset {\n const offset = this.offsetOf(member.data);\n const shift = this.shiftOf(member.data, scales);\n return { dx: offset.dx + shift.dx, dy: offset.dy + shift.dy };\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 and point-range types are part of those configs' public shape, so they're\n// exported alone.\nexport { PcacPointImageConfig, PcacPointRangeConfig, PcacPointRangeShow, PcacPointRangeStyle } 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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